-
Notifications
You must be signed in to change notification settings - Fork 174
Respect connect_timeout #169
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
Conversation
Hi @ansd |
Prior to this commit, when the client created a TCP connection with the server and the server did not respond with a CONNACK (for example because the server is blocked due to overload), the client was stuck in state waiting_for_connack without respecting the configured connect_timeout.
Thanks @zmstone. |
The problem, seems to be the use of Lines 779 to 780 in fdd9959
and here: Line 834 in fdd9959
i.e. any event will cause the timer to be cancelled. adding another event_timeout() after handing the event may seem to fix the issue, but maybe not the optimal way.
Should maybe use a |
A side-note: |
As @zmstone pointed out, using a state_timeout() for state waiting_for_connack makes more sense than an event_timeout() because any event will cause an event_timeout() to be cancelled. The total time in state waiting_for_connack should not exceed the configured connect_timeout (no matter what events are received).
Very good point and thanks for the explanation @zmstone: a |
Given that emqx/emqtt#169 has been merged and a new tag has been set on emqx/emqtt, we do not need the fork ansd/emqtt anymore.
Given that emqx/emqtt#169 has been merged and a new tag has been set on emqx/emqtt, we do not need the fork ansd/emqtt anymore. (cherry picked from commit 307e673)
Given that emqx/emqtt#169 has been merged and a new tag has been set on emqx/emqtt, we do not need the fork ansd/emqtt anymore. (cherry picked from commit 307e673) (cherry picked from commit 7fffaac)
Given that emqx/emqtt#169 has been merged and a new tag has been set on emqx/emqtt, we do not need the fork ansd/emqtt anymore. (cherry picked from commit 307e673) (cherry picked from commit 7fffaac) (cherry picked from commit a52fb2f)
Prior to this commit, when the client created a TCP connection with the
server and the server did not respond with a
CONNACK
(for examplebecause the server is blocked due to overload), the client was stuck in
state
waiting_for_connack
without respecting the configuredconnect_timeout
.