[launchd-dev] Enforce a maximum time that a launchd process can live...

Michael Ledford michael at ledford.cc
Tue Jan 26 11:23:49 PST 2010


On Jan 26, 2010, at 12:14 PM, Damien Sorresso wrote:

> Is the NSMutableURLRequest encapsulated in some API that you're  
> using which doesn't support a timeout interval? Because  
> NSMutableURLRequest itself does.

No, the problem is with the NSMutableURLRequest itself. Even though it  
supports a timeout, default is 60 seconds, it simply gets stuck. I  
spoke with an engineer at WWDC about it and he was perplexed when we  
connected to a machine with the process and sampled it. In any case  
this subject is off topic for this list.

> If this is the case, you can spin the synchronous call out into its  
> own thread/GCD queue and install a timer that exits after 20 seconds  
> (or however long you'd like).

I was contemplating installing an alarm, using ualarm(), and just  
allowing the default handler terminate when it gets the SIGALRM. Would  
this be acceptable?

Thanks,
Michael


More information about the launchd-dev mailing list