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

Fix dangling timer when lazy connection closes with pending commands #105

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

clue
Copy link
Owner

@clue clue commented Sep 25, 2020

This is a somewhat hidden and rare race condition. The faulty idle timer
would be started when the underlying Redis connection closes while the
lazy connection still has pending commands, such as a blocking BLPOP
operation. The timer would trigger some timer after the connection has
been closed and would try to close the connection again, thus
referencing undefined variables and causing a hard error in this case.

The idle timer should not be started when the connection is already
closed.

This is a somewhat hidden and rare race condition. The faulty idle timer
would be started when the underlying Redis connection closes while the
lazy connection still has pending commands, such as a blocking BLPOP
operation. The timer would trigger some timer after the connection has
been closed and would try to close the connection again, thus
referencing undefined variables and causing a hard error in this case.

The idle timer should not be started when the connection is already
closed.
@clue clue added the bug label Sep 25, 2020
@clue clue added this to the v2.4.0 milestone Sep 25, 2020
@clue clue merged commit 8e88116 into clue:master Sep 25, 2020
@clue clue deleted the lazy-closed branch September 25, 2020 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant