-
Notifications
You must be signed in to change notification settings - Fork 171
fix(websocket): avoid long stop time when waiting to auto-reconnect (IDFGH-14393) #729
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
base: master
Are you sure you want to change the base?
fix(websocket): avoid long stop time when waiting to auto-reconnect (IDFGH-14393) #729
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@PaoloPasinetti , please, resolve the merge conflicts so that we can submit this |
7f1daa7
to
ed33f29
Compare
@PaoloPasinetti , thanks for the updates. The target pipelines are failing but it seems that the server we use for tests is down (wss://echo.websocket.events). lets wait a while to be sure that the pipelines are passing and then I'll merge this. |
I just merged a fix to the pipeline issue, please, rebase your branch. thanks! |
This commit fixes an issue that occurred when auto-reconnection is enabled, and the client is disconnected from the server. In this situation, if the esp_websocket_client_stop() method is called, the caller could remain stuck waiting for a maximum time equal to half of wait_timeout_ms. This fix allows the esp_websocket_client_task to be woken up when it is waiting to reconnect, so it can be closed promptly when requested.
ed33f29
to
91e7e9f
Compare
Description
This fixes an issue that occurred when auto-reconnection is enabled, and the client is disconnected from the server. In this situation, if the
esp_websocket_client_stop()
method is called, the caller could remain stuck waiting for a maximum time equal to half ofreconnect_timeout_ms
.This fix allows the
esp_websocket_client_task
to be woken up when it is waiting to reconnect, so it can be closed promptly when requested byesp_websocket_client_stop()
.Testing
Procedure:
disable_auto_reconnect = false
andreconnect_timeout_ms = 180000
WEBSOCKET_STATE_WAIT_TIMEOUT
, callesp_websocket_client_stop()
Before these changes, the
esp_websocket_client_stop()
method could remain stuck for up to 90000 ms, half ofreconnect_timeout_ms
. With the implementation of this fix, the internal client task is woken up and stoppedChecklist
Before submitting a Pull Request, please ensure the following: