-
Notifications
You must be signed in to change notification settings - Fork 68
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 session leak #121
Comments
I found cause of the problem, this is deadlock on protocol level. I don't think it is possible to fix this problem. I will try to mitigate it with keep-alive timer. v3 server has in-flight limit, but default it is 16 message, if client sends 16 publishes server stops reading from socket, implementation of publish service in subs example sends publishes to client and expect ack before it ack's client's publish, but if server stops reading incoming data it cannot read ack from client so all inflight publishes stays in queue and never resolves. |
Tricky. Wouldn't it work if (in this case) the socket would be closed, and so at least the session could be cleaned up? Sending either a "peer gone" event, or some dedicated "session overflow" event? |
problem is that we pause read/write operations on socket, we cannot get disconnect event from it. i’ve been thinking about timeout if socket operations stop, i will try to build something next couple days |
I have the feeling there is a session leak in the server code in case the server gets "too many" messages.
This is the scenario:
Use the
subs.rs
exampleInstead of returning
Ok()
in the publish method, use:Implement
Drop
forMySession
, print out somethingNow when you send one message, it processes it, fails, closes the connection and prints out the message from
drop
.If you send e.g. 20 messages at once, it processes all of the, closes the connection, but doesn't print out the message. This is pretty reproducible.
My assumption is, the session is still lingering somewhere.
The text was updated successfully, but these errors were encountered: