-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Possible race condition using emqttd_cm #486
Comments
@obi458, Agree that there is a possible race condition issue. I will check the design later. But notice that you should not lookup the 'mqtt_client' record in on_client_subscribe for the function is called by session process. The session and client may be on different nodes in a cluster. |
Ok, i have only "bridge cluster", but in an "erlang cluster" this could be a problem with the I think a "global" MQTT Client Manager should solve it! |
Hi @obi458, please checkout the latest '0.17' branch and verify this issue. Thanks. |
Works, the 120 seconds timeout is your experience or a pessimistic value? |
The timeout is a tradeoff to ensure the broker could handle about 1k+ TCP connections per second. @obi458, would you like to benchmark the fix? The tool: https://github.com/emqtt/emqtt_benchmark
|
Processing.... |
1.0 - update design guide and fix issue #486
Hi @obi458, could we close the issue now? |
Closed! |
So it is possible that the client is being registered(async) while for example
on_client_subscribe(ClientId, TopicTable, _Env), i need the mqtt_client record,
emqttd_cm:lookup(ClientId)(sync) gives undefined!
The text was updated successfully, but these errors were encountered: