-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Respect server request to drop decision logs #5638
Comments
Some thoughts I had while reading this: how does the server know that the OPA client needs to drop decisions? "429 Too many requests" would to me indicate that the server currently can't handle the load from potentially many clients, but I'm not sure that automatically translates to a signal for the client to start discarding decision logs. The client could be well-prepared for this with plenty of memory available, in which case I'd expect the client to keep the logs, the exponential backoff to tick up and the client to try again a little later. Would this behavior be configurable? |
|
Like that snarky saying goes: “Poor planning on your part does not constitute an emergency on my part” — i.e. that the server is currently under heavy load, perhaps from a temporary spike, does not automatically mean that a client should need to do something as drastic as dropping decisions if it's capable of keeping them and sending them off at a later point in time. I don't mind the option, but I do think this should be configurable, and not the default behavior. One concern I have is that there might be machines involved between the client and the decision log server — i.e. gateways or proxies — that could send this status code too. Those kind of scenarios are almost never tested for, so could very well manifest in production making for some truly hard to debug situations. But as long as this is actively set by the user, at least they've made the choice themselves. |
Isn't a Instead of having the server explicitly tell us when to start dropping records, perhaps it's more appropriate to have the client config define under what circumstances it's ok to start dropping data, if ever. I'm thinking the most likely such circumstance might be when the client is starting to run out of memory (or has reached some configured threshold). If auditing is a concern for the setup, it's probably better for OPA to stop accepting queries, rather than dropping the decision log. |
OPA periodically uploads decision logs to a remote server. If the server responds with a non-2xx status code, OPA will re-queue those decision log event(s) in its buffer and attempt to upload them again after an exponential backoff delay mechanism. Currently there is no way for the server to indicate to OPA to drop those decision log event(s). It would be nice if OPA was able to drop those decision log event(s) along with the exponential backoff if server responded with
HTTP 429
status code.The text was updated successfully, but these errors were encountered: