Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we abort the gateway on register_watch() failure? #594

Open
gbregman opened this issue Apr 17, 2024 · 0 comments
Open

Should we abort the gateway on register_watch() failure? #594

gbregman opened this issue Apr 17, 2024 · 0 comments

Comments

@gbregman
Copy link
Contributor

In the register_watch() code in state.py we have:

    def register_watch(self, notify_event):
        """Sets a watch on the OMAP object for changes."""

        def _watcher_callback(notify_id, notifier_id, watch_id, data):
            notify_event.set()

        if self.watch is None:
            try:
                self.watch = self.ioctx.watch(self.omap_name, _watcher_callback)
            except Exception:
                self.logger.exception(f"Unable to initiate watch")
        else:
            self.logger.info(f"Watch already exists.")

in case we got an exception in self.ioctx.watch() we display it to the log but continue working. So, in such a case we'll continue running the gateway but it won't get notifications about OMAP updates. We'll still run updates using the timer if this is enabled. So, we need to decide if we're OK with that or do we want to abort the gateway in such a case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant