-
Notifications
You must be signed in to change notification settings - Fork 908
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
rec: drop ref in mtasker when it is no longer needed #14807
Conversation
If we do not do that, only the next call of sendEvent will release the shared pointer to the TCPConnectionHanlder in PacketID. This might delay cleaning TCP objects up on not-so-busy threads. Fixes PowerDNS#13422, thought it can still take a while on idle recursors, as the housekeeping function is not called often in those cases.
Here no refs being lowered (for the rec case) but it might save a few cycles
cc5acce
to
9ed4b34
Compare
Pull Request Test Coverage Report for Build 11665554436Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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.
Looks good to me!
If it's not a lot of work (I have no idea how hard it would be), adding a unit test to ensure that we do not re-introduce the same issue in the future might be a good idea.
deb7a19
to
8ea3723
Compare
Short description
If we do not do that, only the next call of
sendEvent
will releasethe shared pointer to the
TCPConnectionHandler
inPacketID
as it overwritesd_eventkey
. Same ford_waitval
. Thismight delay cleaning TCP objects up on not-so-busy threads.
Fixes #13422, thought it can still take a while on idle recursors,
as the housekeeping function is not called often in those cases.
Added a simple mechanism to make sure
d_eventkey
is not used when it is not set yet or after being moved.Checklist
I have: