cyrusimap / cassandane

Other
6 stars 11 forks source link

Cassandane::Daemon::kill_processes_on_ports() may not actually work #59

Open elliefm opened 6 years ago

elliefm commented 6 years ago

I haven't spent a lot of time in this yet but I think it may be misparsing the netstat output and then not finding stray processes to kill.

elliefm commented 6 years ago

This might be the cause of #5

elliefm commented 5 years ago

Key observation from #69 was this:

=====> Daemon[421] ERROR!! killing stray process perl on port 9100
=====> Instance[1258] _stop_pid: sending signal 15 to 12118
=====> Util::Wait[75] Waited 0.010504 sec for unknown condition
=====> Daemon[421] ERROR!! killing stray process perl on port 9100
=====> Instance[1258] _stop_pid: sending signal 15 to 12118
=====> Instance[1259] Can't send signal 15 to pid 12118: No such process

Observe here that it's trying to kill pid 12118 twice, even though the first time succeeded. This is because the process is listening to this port on both inet and inet6, and the algorithm looks up each protocol separately then concatenates the list of found processes.