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

Clear out timeout timer when connection is made #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Clear out timeout timer when connection is made #90

wants to merge 1 commit into from

Conversation

rmdave
Copy link

@rmdave rmdave commented Jun 23, 2016

I init() a connection, send() messages and then end() the connection in less than 500ms. The timer was on the event loop so node would exit after 3+ seconds. My logic now exits in less than 500ms with this change.

I init() a connection, send() messages and then end() the connection in less than 500ms.  The timer was on the event loop so node would exit after 3+ seconds.  My logic now exits in less than 500ms with this change.
@steve-gray
Copy link
Contributor

steve-gray commented Sep 12, 2016

I added some code a while back to deal with this scenario during unit tests where I was spinning up a thing that held a no-kafka client and shutting it down before doing anything, and in my haste I may have made this particular problem worse. This looks like a useful fix though, because that timer often hangs around and troubleshooting no-kafka connection internals with wtfnode can sometimes be confused by having those timer callbacks alive.

If you're fast enough too, you'll notice that any mocha tests would wait at least 5 seconds until the timeout had run - even if they completed instantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants