permitio / opal

Policy and data administration, distribution, and real-time updates on top of Policy Agents (OPA, Cedar, ...)
https://opal.ac
Apache License 2.0
4.48k stars 163 forks source link

BasePolicyWatcherTask: Signal stop if broadcaster fails to connect #606

Closed roekatz closed 3 months ago

roekatz commented 3 months ago

This is blocked by merging that PR - https://github.com/permitio/fastapi_websocket_pubsub/pull/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.

netlify[bot] commented 3 months ago

Deploy Preview for opal-docs canceled.

Name Link
Latest commit 6d8063053f8ac07195caf74693a2129906586bbb
Latest deploy log https://app.netlify.com/sites/opal-docs/deploys/667d8f4996be6700083a614c
danyi1212 commented 3 months ago

Tests and pre-commit are failing

danyi1212 commented 3 months ago

Tests are failing