Improve connection cleanup in replication connection pool #1636
Conversation
Previously when an owner process crashed before it had a chance to release the worker to the pool, the worker entry was simply deleted. In some cases that was ok because ibrowse's inactivity timeout would kick in and connection would stop itself. In other cases, as observed in practice with _changes feed connection over TLS protocol, inactivity timeout would never fire, so these deleted connections would slowly accumulate leaking memory and filling the process table. TLS connection would keep an associated session open as well making things even worse. To prevent the connection leak, explicitly unlink and kill the worker.
260c844
to
505ffbf
oops :) |
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.
Previously when an owner process crashed before it had a chance to release the
worker to the pool, the worker entry was simply deleted. In some cases that
was ok because ibrowse's inactivity timeout would kick in and connection would
stop itself. In other cases, as observed in practice with _changes feed
connection over TLS protocol, inactivity timeout would never fire, so these
deleted connections would slowly accumulate leaking memory and filling the
process table. TLS connection would keep an associated session
open as well making things even worse.
To prevent the connection leak, explicitly unlink and kill the worker.