Re: [Tracker] Killing run-away child processes



On 11/15/06, Jamie McCracken <jamiemcc blueyonder co uk> wrote:
Edward Duffy wrote:
> Text filtering, metadata extraction, and thumbnail generation are all
> handled out of process so they can't crash trackerd.  However these
> processes are called with g_spawn_sync and there's no gaurentee they
> will come back.
>
> Here's a patch that will set SIGALRM for these external processes, it
> uses the child_setup callback function, so there's no need for every
> possible child process to set its own alarm.
>
>

so we get back a SIGALRM signal which we dont currently handle after 30
secs?

that's the idea

dont we need a way to kill these external processes if they timeout?

nope..that's what alarm is for.  Put "while (1);" in tracker-extract.c
if you want to try it out.

(kinda tricky without the pids although we could execute "killall -9
tracker-extract" though that wont do for the other types and is a bit
hacky!)

that's why there's alarm!  trackerd doesn't get the alarm, the child
process does.

Another way to do this is within tracker-extract with the extraction
performed in another thread with the main thread being a timer that
kills itself if it timeouts. We could also have a tracker-filter program
to do likewise with text filters ( and tracker-thumb too) - it would be
cleaner but do you fancy doing the work?

I could, but it'll be a while... I'm going out of town for the next
week and a half

--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/





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