Skip to content

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

Merged
clue merged 1 commit into
clue:masterfrom
clue-labs:lazy-closed
Sep 25, 2020
Merged

Fix dangling timer when lazy connection closes with pending commands#105
clue merged 1 commit into
clue:masterfrom
clue-labs:lazy-closed

Conversation

@clue
Copy link
Copy Markdown
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 Something isn't working 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

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant