prevent dupes in event loop on Consumer restart (causing leak?)#7187
Merged
auvipy merged 1 commit intocelery:masterfrom Dec 25, 2021
Merged
prevent dupes in event loop on Consumer restart (causing leak?)#7187auvipy merged 1 commit intocelery:masterfrom
auvipy merged 1 commit intocelery:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7187 +/- ##
==========================================
- Coverage 89.36% 89.35% -0.01%
==========================================
Files 138 138
Lines 16759 16759
Branches 2448 2448
==========================================
- Hits 14976 14975 -1
- Misses 1553 1554 +1
Partials 230 230
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
auvipy
reviewed
Dec 25, 2021
Member
auvipy
left a comment
There was a problem hiding this comment.
can the coverage improved little bit more? also were were you abe to pass integration tests locally with this changes?
|
This pull request introduces 3 alerts and fixes 1 when merging bc00526 into 843396e - view on LGTM.com new alerts:
fixed alerts:
|
auvipy
approved these changes
Dec 25, 2021
auvipy
approved these changes
Dec 25, 2021
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, each time the prefork worker encounters a connection error and restarts the
Consumer, it will result in an additionalAsynPool._create_write_handlers.<locals>.on_poll_startgetting added to the event loop (inHub.on_tick). This may be causing a minor memory leak and may slow down the event loop after a lot of connection errors.For more details, I think this is the flow causing the issue:
Expand
This PR prevents the unnecessary duplicate
on_poll_starts from getting added to the event loop on each Consumer restart by allowinghub.on_tick.add(self.on_poll_start)to run only once per instance ofAsynPool.