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

BasePolicyWatcherTask: Signal stop if broadcaster fails to connect #606

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

roekatz
Copy link
Collaborator

@roekatz roekatz commented Jun 26, 2024

This is blocked by merging that PR - permitio/fastapi_websocket_pubsub#77
And releasing fastapi_websocket_pubsub 0.3.8

Until now EventBroadcaster wasn't raising an error if listening Broadcaster channel failed to connect.
Now that it does (see related fix in fastapi_websocket_pubsub), we should also detect it in the BasePolicyWatcherTask and end that long lived task so the opal-server worker process closes and restarts (rather than remaining in a static erroneous limbo state)

A more fancy implementation would be retrying the failed connection (to avoid unnecessarily restarting the worker), but that could be later improved.

@roekatz roekatz requested a review from obsd June 26, 2024 14:51
Copy link

netlify bot commented Jun 26, 2024

Deploy Preview for opal-docs canceled.

Name Link
🔨 Latest commit 6d80630
🔍 Latest deploy log https://app.netlify.com/sites/opal-docs/deploys/667d8f4996be6700083a614c

@roekatz roekatz requested a review from danyi1212 June 27, 2024 08:53
@danyi1212
Copy link
Collaborator

Tests and pre-commit are failing

@roekatz roekatz force-pushed the rk/raise-broadcaster-conn-failure-from-watcher-task branch 2 times, most recently from 13af435 to 837212b Compare June 27, 2024 15:49
@roekatz roekatz force-pushed the rk/raise-broadcaster-conn-failure-from-watcher-task branch from 837212b to 6d80630 Compare June 27, 2024 16:11
@roekatz roekatz marked this pull request as ready for review July 1, 2024 11:02
@danyi1212
Copy link
Collaborator

Tests are failing

@roekatz roekatz merged commit 6fff757 into master Jul 2, 2024
12 checks passed
@roekatz roekatz deleted the rk/raise-broadcaster-conn-failure-from-watcher-task branch July 2, 2024 13:52
@roekatz roekatz restored the rk/raise-broadcaster-conn-failure-from-watcher-task branch July 17, 2024 10:41
@roekatz roekatz deleted the rk/raise-broadcaster-conn-failure-from-watcher-task branch July 17, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants