-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Status plugin delays start-up when falling back to persisted bundles #6343
Comments
Also notice that the |
See open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
See open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
See open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
Good catch. This is a bug. |
This appears to be related to the loop activating plugins here: https://github.com/open-policy-agent/opa/blob/main/plugins/discovery/discovery.go#L240. It'd be good to avoid having the status plugin delaying boot when using persisted bundles. @charlieegan3 I haven't tried this but have we looked into using buffered channels? |
Alternatively since the manager has the plugin status on it, we could do the status upload async. |
Hey, I've been having a play with using a buffered channel for the updates this morning. It works, but our tests are quite brittle around some of this stuff and so they need to be reworked. I'll see where I can get to this afternoon. |
#6345 is all I had time for today. I've tried to make some careful updates to tests to maintain the behaviour, but remove the expectation that the status plugin will be in State:OK immediately. Take a look, I'm out tomorrow so feel free to take over and make edits as needed. |
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
This is all that's needed to fix open-policy-agent#6343 Signed-off-by: Charlie Egan <[email protected]>
Fixes #6343 A status endpoint that times out, will no longer delay boots. Signed-off-by: Charlie Egan <[email protected]>
When persisting discovery bundles, and having configured a status service, when opa restarts during downtime in the status service, startup is delayed while attempting to run status plugin.
To reproduce the issue:
Create a simple go server:
Run the server:
Create some opa config:
Run OPA, clearing the local state:
OPA starts ok, and the bundles are persisted to disk.
Now stop the go server and OPA, and run the server in 'timeout mode' where a dial timeout is simulated:
Now run OPA again, using the local state:
We see OPA waits trying to report the status before starting:
Note the timestamps, and that all this time the agent isn't serving. The instance does start, but it is delayed.
This appears to be related to the loop activating plugins here: https://github.com/open-policy-agent/opa/blob/main/plugins/discovery/discovery.go#L240. It'd be good to avoid having the status plugin delaying boot when using persisted bundles.
The text was updated successfully, but these errors were encountered: