Alexey Vlasov writes:

On Tue, Jan 12, 2021 at 07:01:01AM -0500, Sam Varshavchik wrote:
>
> Courier uses the FAM library, which handles server communications, and which
> creates and manages this socket, that is not accessible to Courier or any
> other client app.

Thank you for your quick answer!

Is it possible to make something like this:
if FAM socket is broken we will try to kill it and make FAM_open()
again and continue user's authorization? that is what I am doing now
with my hands from bash shell.

The FAM socket is created internally, by the library, and Courier has no access to it.

The only remedy that the current code does is set a watchdog timer and kill the entire process if it's stuck. You probably caught the imapd process waiting for the 15 second timer to expire, then it kills itself.

Presumably the gam_server process is still racking up CPU time, stracing it should be useful to forward to gam.

But the courier process has no access to the socket, and the only reasonable and reliable remedy is for it to SIGKILL itself. This avoids accumulation of dead processes, stuck, doing nothing, requiring nothing.

It's theoretically possible to run "ps" in a subprocess and kill the gam_server process. That will result in a failed socket connection. But that's not going to be reliable, there will likely be multiple gam_server processes and there is no convenient way to find the right one.

Attachment: pgpSwxY0FpSzQ.pgp
Description: PGP signature

_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to