From ed75496b3ebb2daddce7ec435694c814ed36a913 Mon Sep 17 00:00:00 2001 From: Cole Walker Date: Mon, 21 Nov 2022 12:07:25 -0500 Subject: [PATCH] [PTP] Clear nodeinfo on notification worker init The notificationclient is unable the query ptp status from the notificationservice container after the node is restarted, or if the notificationclient container is restarted. The root issue is because the nodeinfo_repo created in consume_location_event() is persisted between container restarts and the location information stored there is not re-read into the DaemonControl self.service_nodenames. This results in the notificationclient reporting that the notificationservice is unreachable. Fixed by clearing the entries in the nodeinfo repo on initialization so that they can be re-created from incoming location announcements. Test plan: PASS: Build and deploy notificationclient image PASS: Able to pull ptp status after container restart Closes-bug: 1997266 Signed-off-by: Cole Walker Change-Id: I1a56d2c3fca050ab179b549e89e8cfa91f532f4d --- .../notificationclientsdk/services/notification_worker.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/notificationclient-base/docker/notificationclient-sidecar/notificationclientsdk/services/notification_worker.py b/notificationclient-base/docker/notificationclient-sidecar/notificationclientsdk/services/notification_worker.py index 469b828..07c73d7 100644 --- a/notificationclient-base/docker/notificationclient-sidecar/notificationclientsdk/services/notification_worker.py +++ b/notificationclient-base/docker/notificationclient-sidecar/notificationclientsdk/services/notification_worker.py @@ -71,6 +71,9 @@ class NotificationWorker: self.service_nodenames = service_nodenames + nodeinfo_repo = NodeRepo(autocommit=True) + nodeinfo_repo.delete(Status=1) + self.__locationinfo_handler = \ NotificationWorker.LocationInfoHandler(self) self.__notification_handler = NotificationHandler()