Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pillar/deferred: properly merge deferred requests
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>
- Loading branch information