-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handle Thread#raise and Thread#kill (#963)
Fix: #956 While it's heavily discouraged, `Timeout.timeout` end up being relatively frequently used in production, so ideally it's better to try to handle it gracefully. This patch is inspired from redis-rb/redis-client@5f82254 before sending a request we flip a flag, and once we fully read the response(s), we flip it back. If the flag is not `false` when we start a request, we know the connection may have unread responses from a previously aborted request, and we automatically discard it. Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
- Loading branch information
1 parent
0483446
commit c01d410
Showing
5 changed files
with
144 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters