Fix #558 #619 by revising RTMClient to accept simultaneous incoming messages#667
Fix #558 #619 by revising RTMClient to accept simultaneous incoming messages#667seratch merged 1 commit intoslackapi:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #667 +/- ##
=======================================
Coverage 87.17% 87.17%
=======================================
Files 15 15
Lines 1824 1833 +9
Branches 100 103 +3
=======================================
+ Hits 1590 1598 +8
+ Misses 202 201 -1
- Partials 32 34 +2
Continue to review full report at Codecov.
|
| if num_of_running_callbacks > 0: | ||
| self._logger.info( | ||
| "WebSocket connection has been closed " | ||
| f"though {num_of_running_callbacks} callback executions were still in progress" |
There was a problem hiding this comment.
This is just a msg for the devs that they lost some executions by running close? Guessing we wouldn't want to halt the close event
There was a problem hiding this comment.
Yes, as you guessed, this message is meant for giving a bit more information for developers for the case they unexpectedly encounter this situation. This message indicates that if some of the remaining tasks are going to send messages back to the Slack server over a WebSocket connection, it won't work. If the remaining tasks don't talk to the Slack server, they're not terminated yet, so that they may result in success.
Summary
This pull request fixes #558 #619.
The cause of the issue addressed by this pull request is that the current implementation of
RTMClienthandles incoming WebSocket messages one by one (=sequentially). As a result, the following code blocks other handlers until the sleep time (10 seconds) passes.This pull request changes the internals of
RTMClienta bit to accept simultaneous text messages. Error events and connection close events should not be executed asynchronously.@stevengill @aoberoi @shaydewael
As #665 and this pull request have a conflict, I need to merge them into one. But I think having reviews separately should be easier for these cases. After waiting for reviews by others for a few business days, I'll come up with a unified pull request and close this and #665.
Requirements (place an
xin each[ ])