title: Is an XPC interruption handler called when launchd kills the process?
body: <p>The documentation for the <code>interruptionHandler</code> block of <a href="http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSXPCConnection_reference/translated_content/NSXPCConnection.html"><code>NSXPCConnection</code></a> states:</p>
  
  <blockquote>
    <p>An interruption handler that is called if the remote process exits or crashes.</p>
  </blockquote>
  
  <p>However, the <a href="http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingXPCServices.html">Daemons and Services Programming Guide</a> states:</p>
  
  <blockquote>
    <p>XPC services are managed by launchd, which launches them on demand, restarts them if they crash, and terminates them (by sending SIGKILL) when they are idle. This is transparent to the application using the service, except for the case of a service that crashes while processing a message that requires a response. In that case, the application can see that its XPC connection has become invalid until the service is restarted by launchd</p>
  </blockquote>
  
  <p>If an XPC process is killed for being idle, will I get a callback in my <code>interruptionHandler</code>? Or will I only get the callback when the app crashes while processing a message? I ask because this test case seems like it's impossible to simulate. XPC service lifecycle is unfortunately a very black box.</p>