Closed symphorien closed 3 years ago
I can confirm, running
for i in $(seq 1 100); do
lorri internal stream-events --kind snapshot
done
and then checking the lorri daemon
process with
lsof <lorri daemon pid>
shows that 100 fds to the socket are open, so incoming fds are not dropped. I think it might also be the case that handler threads are still running, checking.
Update: the same does not happen with lorri ping
.
If you run lorri daemon -v
it shows the reason:
Apr 03 10:24:57.030 DEBG client vanished, error: Serialize(Io(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })), communication_type: StreamEvents
Apr 03 10:24:57.030 DEBG Sent new listener sectionend, keep: true
The handler panics (because the code was badly written), and thus the drop
function of the file handle is not run, leaving the file open.
It wasn’t actually a panic, just a mishandled error condition which didn’t stop the worker thread:
you can see that the handler continues in the loop, even though the client has vanished.
Describe the bug running
lorri internal stream-events --kind snapshot
leaks 2 fds in the daemon.To Reproduce Steps to reproduce the behavior:
while sleep 1; do lorri internal stream-events --kind snapshot; done
watch 'lsof -p 1234 | wc -l'
where 1234 is the pid of lorri daemonExpected behavior the number of file descriptor is more or less constant
Metadata
revision: current canon: 4fb9199c5d205e18a62442b857cc2f19207fbb8e