Yes, an interrupt handler will be called if launchd stops the service for downtime.
This can be modeled by using a natural reaction launchd has a memory pressure: stopping all running running services that are idle to help fix the problem.
A simulated warning pressure level in your memory should be enough, here's how you do it:
sudo memory_pressure -S -l warn
And for critical:
sudo memory_pressure -S -l critical
This condition is often overlooked when testing XPC services. However, it is recommended that XPC services be inactive, so in most cases it does not matter if your service is stopped and can be restarted the next time you send a message at startup. And ideally, you canceled the connection the last time you were with him.
Launchd will not stop the XPC service with the above conditions if there is a current XPC transaction (read: message is being processed and / or the response block has not been called).
amcc
source share