-
Notifications
You must be signed in to change notification settings - Fork 164
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
[10.4 stable] Prevent deferred queue from growing #4030
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to have the PR reference in the descriptions.
But we should also have the original master commit in the commit messages.
(And if you do that with git cherry-pick -x I suspect that would have carried the DCO signature across as well.)
In any case, the DCO needs to be fixed.
Will add once master is merged, otherwise SHA may change. |
Something already unfixable:
|
FWIW that is bogus from more than one perspective:
I don't know what's broken in GH. Let's see what happens when you update the commit descriptions if DCO still has issues. |
…C reqs LOC has different URL, so controller and LOC deferred requests can't be placed into the same queue due to the same requests keys. Having two destinations (controller + LOC), the second sender overrides a deferred item, so first one destination will be never reached. First attempt to fix this was made here: 62b00e2 ("zedcloud/deferred: respect URL argument as a key on starting new deferred") But this introduces more problems then fixes them (for example `RemoveDeferred()` was not covered at all). This is the proper way to deal with different destinations. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> (cherry picked from commit 713af84)
This fixes the growing deferred queue issue caused by missing request merges. Commit 9f2c9ad ("zedcloud/deferred: don't take lock while processing the deferred queue") relaxes locks and makes it possible to add new requests while queue processing waits in send. New requests should land in the same `deferredItems` list, which should be processed later at the end of the `handleDeferred()` operation. The bug lies in the actual merging of two queues: the one that has not been completed due to a possible error and the other queue, which was populated with new requests during the send. Proper queue merging is not just concatenation of queues (which would cause the resulting queue to always grow), but involves item replacement by key, so the queue size stays the same, with the item being replaced. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> Fixes: 9f2c9ad ("zedcloud/deferred: don't take lock while processing the deferred queue") Reported-by: Milan Lenco <milan@zededa.com> (cherry picked from commit 4582efb)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Backport of the #4017 PR.