Commit 40f4397d authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

some more messages

parent deefcf34
......@@ -574,8 +574,9 @@ class LocalfsFileClient(FileClient):
cached_info = None
if self.exclude_file(objname):
logger.warning("Ignoring probe archive: %s, object: %s" %
(old_state.archive, objname))
msg = messaging.IgnoreProbeMessage(
archive=old_state.archive, objname=objname, logger=logger)
self.settings.messager.put(msg)
return
live_info = (self._local_path_changes(objname, old_state)
......
......@@ -50,6 +50,15 @@ class UpdateMessage(Message):
(self.archive, self.objname, self.serial))
class IgnoreProbeMessage(Message):
def __init__(self, *args, **kwargs):
Message.__init__(self, *args, **kwargs)
self.archive = kwargs["archive"]
self.objname = kwargs["objname"]
self.logger.warning("Ignoring probe archive: %s, object: %s" %
(self.archive, self.objname))
class AlreadyProbedMessage(Message):
def __init__(self, *args, **kwargs):
Message.__init__(self, *args, **kwargs)
......@@ -80,6 +89,25 @@ class HeartbeatNoDecideMessage(Message):
% self.objname)
class HeartbeatReplayDecideMessage(Message):
def __init__(self, *args, **kwargs):
Message.__init__(self, *args, **kwargs)
self.objname = kwargs["objname"]
self.heartbeat = kwargs["heartbeat"]
self.logger.info("Found heartbeat with current ident %s"
% self.heartbeat["ident"])
class FailedSyncIgnoreDecisionMessage(Message):
def __init__(self, *args, **kwargs):
Message.__init__(self, *args, **kwargs)
self.objname = kwargs["objname"]
self.serial = kwargs["serial"]
self.logger.warning(
"Ignoring failed decision for: '%s', decision: %s" %
(self.objname, self.serial))
class LiveInfoUpdateMessage(Message):
def __init__(self, *args, **kwargs):
Message.__init__(self, *args, **kwargs)
......
......@@ -202,8 +202,9 @@ class FileSyncer(object):
(objname, beat))
if beat is not None:
if beat["ident"] == ident:
logger.info("Found heartbeat with current ident %s"
% ident)
msg = messaging.HeartbeatReplayDecideMessage(
objname=objname, heartbeat=beat, logger=logger)
self.messager.put(msg)
else:
if utils.younger_than(
beat["tstamp"], self.settings.action_max_wait):
......@@ -231,9 +232,9 @@ class FileSyncer(object):
"does not match any archive." %
(decision_serial, objname))
else:
logger.warning(
"Ignoring failed decision for: '%s', decision: %s" %
(objname, decision_serial))
msg = messaging.FailedSyncIgnoreDecisionMessage(
objname=objname, serial=decision_serial, logger=logger)
self.messager.put(msg)
if master_serial > sync_serial:
if master_serial == decision_serial: # this is a failed serial
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment