def notify_alert_response(self, responder, alert_ctx, mdmt_used):
"""
Updates view of current network topology state based on the route traveled by this response. Also records that
this subscriber was reached so that future re-tries don't worry about reaching it.
:param responder:
:param alert_ctx:
:type alert_ctx: RideD.AlertContext
:param mdmt_used: we require this instead of gleaning it from the alert_ctx since this response may have been
sent before the most recent alert attempt (i.e. we might calculate the response route wrong)
:return:
"""
# determine the path used by this response and notify RideD that it is currently functional
route = nx.shortest_path(mdmt_used, self.get_server_id(), responder)
log.debug("processing alert response via route: %s" % route)
# NOTE: this likely won't do much as we probably already selected this MDMT since this route was functional...
self.stt_mgr.route_update(route)
alert_ctx.record_subscriber_reached(responder)
if not alert_ctx.has_unreached_subscribers():
log.info("alert %s successfully reached all subscribers! closing..." % alert_ctx)
self.cancel_alert(alert_ctx, success=True)
评论列表
文章目录