Project

Profile

Help

Issue #1380 » 0001-droping-workers-test-fix.patch

jluza, 11/19/2015 11:36 AM

View differences:

server/pulp/server/async/scheduler.py
resource_manager_count = 0
scheduler_count = 0
for worker in worker_list:
_logger.error("worker.last:%s worker.name:%s oldest:%s" % (worker.last_heartbeat, worker.name, oldest_heartbeat_time))
if worker.last_heartbeat < oldest_heartbeat_time:
msg = _("Worker '%s' has gone missing, removing from list of workers") % worker.name
_logger.error(msg)
......
# this is not an event that gets sent anywhere. We process it
# immediately.
scheduler_event = {'timestamp': time.time(),
scheduler_event = {'timestamp': float(datetime.utcnow().strftime("%s")),
'type': 'scheduler-event',
'hostname': ("%s@%s" % (SCHEDULER_WORKER_NAME, platform.node()))}
worker_watcher.handle_worker_heartbeat(scheduler_event)
server/pulp/server/async/worker_watcher.py
_logger.info(msg)
Worker.objects(name=event_info['worker_name']).\
update_one(set__last_heartbeat=event_info['timestamp'], upsert=True)
update_one(set__last_heartbeat=datetime.utcfromtimestamp(event.get("local_received", event['timestamp'])), upsert=True)
def handle_worker_offline(event):
(1-1/2)