forked from lf-edge/eve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zedcloud/deferred: don't take lock while processing the deferred queue
The ctx.lock protects the concurrent access to the ctx.deferredItems, so no need to keep the mutex locked while processing the queue. Why? Queue processing can take up to several minutes (depends on the send timeout), so that all other goroutines which produce new requests (callers of the SetDeferred() or RemoveDeferred() calls) will stuck for as long as the queue is not completely processed. This mutex contention badly impacts overall system responsiveness. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
- Loading branch information
1 parent
91b0265
commit 9f2c9ad
Showing
1 changed file
with
31 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters