Skip to content
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

Questioning the handling of clean_session #122

Open
joekinley opened this issue May 8, 2020 · 3 comments
Open

Questioning the handling of clean_session #122

joekinley opened this issue May 8, 2020 · 3 comments

Comments

@joekinley
Copy link

The clean_session flag is not possible to be configured in this library. A user will have to live with the decisions made in the code.

https://github.com/gausby/tortoise/blob/master/lib/tortoise/connection.ex#L47
Here it is set to true, meaning "please do clean the session after disconnect, not leaving any remnants in the broker".

https://github.com/gausby/tortoise/blob/master/lib/tortoise/connection.ex#L628
Here it is set to false, meaning "please keep my session indefinitely in the broker".

This forces the user of this library to properly disconnect in order to not leave open sessions (possibly indefinitely) on the broker.

Especially in a cloud situation, on kubernetes, but also in cases of crashes, this might clump up the broker with stale sessions, which even further (when using shared subscriptions) may cause messages to get lost, in certain configured situations.

Does the explicit handling of the clean_session flag outside of the control of the user of the library have any deeper function, or could we maybe make it configurable, giving the control back to the user?

@ryanwinchester
Copy link

#87

@gausby
Copy link
Owner

gausby commented May 11, 2020

This will be left up to the user in the upcoming MQTT 5 version of Tortoise—sorry it takes a while. This is a spare time project, and 2019 was a year where I had other interests and other work to do, but I am trying to get the MQTT 5 version done, and that will change everything.

@joekinley
Copy link
Author

Fine by me. Thanks for your effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants