-
Notifications
You must be signed in to change notification settings - Fork 274
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
IPC leaks connections (when internally using PubSubSession) #275
Comments
debris
added a commit
that referenced
this issue
Jun 6, 2018
Merged
For posterity, here's a repeat-script that worked for me (thanks @debris):
(also, om macos, |
debris
added a commit
that referenced
this issue
Jun 12, 2018
* fixed ipc connection leak, closes #275 * fixed indentation * fixed broken pipe issue in tests * empirical tests fixes * fix tests * fix tests * fix tests * move ipc start_signal.send after the incoming.for_each * log ipc traces on travis * keep writer in memory as long as possible * select_with_weak * remove redundant thread::sleep * test session end * fixed race condition in test_session_end
debris
added a commit
that referenced
this issue
Jun 12, 2018
* fixed ipc connection leak, closes #275 * fixed indentation * fixed broken pipe issue in tests * empirical tests fixes * fix tests * fix tests * fix tests * move ipc start_signal.send after the incoming.for_each * log ipc traces on travis * keep writer in memory as long as possible * select_with_weak * remove redundant thread::sleep * test session end * fixed race condition in test_session_end
debris
added a commit
that referenced
this issue
Jun 12, 2018
* fixed ipc connection leak, closes #275 * fixed indentation * fixed broken pipe issue in tests * empirical tests fixes * fix tests * fix tests * fix tests * move ipc start_signal.send after the incoming.for_each * log ipc traces on travis * keep writer in memory as long as possible * select_with_weak * remove redundant thread::sleep * test session end * fixed race condition in test_session_end
debris
added a commit
that referenced
this issue
Jun 18, 2018
* fixed ipc connection leak, closes #275 * fixed indentation * fixed broken pipe issue in tests * empirical tests fixes * fix tests * fix tests * fix tests * move ipc start_signal.send after the incoming.for_each * log ipc traces on travis * keep writer in memory as long as possible * select_with_weak * remove redundant thread::sleep * test session end * fixed race condition in test_session_end
ascjones
pushed a commit
that referenced
this issue
Jun 18, 2018
* fixed ipc connection leak, closes #275 * fixed indentation * fixed broken pipe issue in tests * empirical tests fixes * fix tests * fix tests * fix tests * move ipc start_signal.send after the incoming.for_each * log ipc traces on travis * keep writer in memory as long as possible * select_with_weak * remove redundant thread::sleep * test session end * fixed race condition in test_session_end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Heyah,
investigating a leak in IPC connections in Parity I was able to pin-point the location to the way that IPC-Server and PubSubSession are interacting leading to an internal circle of never ending futures. Which in turn means we are keeping those connections around even after they've terminated, keep the socket open and - ultimatily - leak those connections as well as memory, causing Parity to be oom-killed (at least I suspect this error to be the cause of that error. Can't rule out there might be another leak).
I've commited a short example triggering that behaviour, together with some code comments of the cause (IMHO) in this branch.
To reproduce this bug, check out the
leaking-ipc-connections-example
branch, cd intoipc
and runRUST_LOG=ipc=trace cargo run --example with-pubsubsession
Now have something connect to the open socket
/tmp/json-ipc-test.ipc
and immediately close again or die, like so:You'll see a bunch of messages appear in the example looking something like
Notice how the closing message
Peer: service finished
is absent -- connections aren't dropped even though the peer is gone.You can also watch it grow the open file handlers with lsof (e.g.
while true; do echo "`date +%s` : `lsof -c with-pubs | wc -l`"; sleep 5; done
)The text was updated successfully, but these errors were encountered: