Skip to content
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

Improve connection cleanup in replication connection pool #1636

Merged

Conversation

@nickva
Copy link
Contributor

@nickva nickva commented Oct 2, 2018

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.

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.
@nickva nickva force-pushed the cloudant:cleanup-replication-conns-on-owner-death branch from 260c844 to 505ffbf Oct 2, 2018
@rnewson
rnewson approved these changes Oct 2, 2018
Copy link
Member

@rnewson rnewson left a comment

oops :)

@nickva nickva merged commit 691605b into apache:master Oct 2, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nickva nickva deleted the cloudant:cleanup-replication-conns-on-owner-death branch Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants