Re: [PATCH v2] udevd: don't use alarm() for timeouts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 26, 2009 at 12:31, Alan Jenkins <alan-jenkins@xxxxxxxxxxxxxx> wrote:
> alarm() is per-process; we can't use it for timeouts in a multi-threaded
> udevd.  We need to explicitly track the total time spent waiting for
> each event.
>
> There is an issue here if the timeout expires in run_program().  If
> run_program() returns without calling wait(), the process it forked
> will become a zombie when it finally exits.  Currently, udev-event is
> implemented as a process, so the zombie will be reparented to init and
> reaped once the event is finished.  But that won't work for threads.
>
> The solution is to fork twice:
>
> udevd (event thread)
>  udevd child process
>  command
>
> When the timeout expires, the event thread can return immediately.
> The child process will stay blocked in wait(), until the command finally
> finishes (or is killed).  We'll get a nice process tree showing that the
> the hung process was started by udevd :-).

The event runs all programs serialized, one after the other, can't we
just kill the program that does not return in time, and wait for it to
cleanup the process, instead of just exiting the event process?

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux