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

Fix bundle state request #794

Closed
koponkin opened this issue Jun 22, 2018 · 1 comment
Closed

Fix bundle state request #794

koponkin opened this issue Jun 22, 2018 · 1 comment

Comments

@koponkin
Copy link

Status request contains errors when all is OK!

Steps to reproduce:

  1. Run bundle server
  2. Run opa service
  3. Stop bundle server
  4. OPA service still running and send POST requests with connection refused error - expected result
  5. Run bundle server (without any changes in policy/data)

OPA send request to bundle server, get response NOT_MODIFIED, but status request does not change and OPA continue send requests with connection refused error.

please fix it ASAP

@bkhablenko
Copy link
Contributor

bkhablenko commented Jun 22, 2018

I second this.

Basically, what @koponkin is saying is that once OPA fails to download a bundle due to a connectivity issue, it will keep reporting its status with an error code until it successfully downloads & activates a bundle – and this won't happen unless there are either policy or data updates on the server.

The described behavior makes sense only if OPA continues to experience connectivity issues, but once it receives any response from the bundle server, 304 Not Modified included, I believe it should stop reporting an error.

tsandall added a commit to tsandall/opa that referenced this issue Jun 22, 2018
Previously, the bundle plugin was only updating the status struct if:

* a download or activation error occurred.
* a new bundle was successfully activated.

As a result, if a transient bundle download/activation error occcured,
OPA would never report that the error condition had been cleared in the
event that the service began serving HTTP 304s.

These changes update the bundle plugin to always set the error status
regardles of whether an error occurred or a new bundle was activated.

Also, refactor the bundle plugin to set all of the activation state
(timestamp, revision, etag) in one place.

Fixes open-policy-agent#794

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
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

No branches or pull requests

2 participants