XPC connection keeps getting interrupted.
- I'm creating an xpc endpoint in FxPlug plugin for FCP X using
xpc_endpoint_create
. - This endpoint is then passed to a helper mach service running in the background and stored there.
- Next, our main application is launched and retrieves the stored endpoint from the helper service.
- It creates the communication channel using
xpc_connection_create_from_endpoint
- The main application communicates with FxPlug plugin using that endpoint.
It all works well when I am debugging either our application or FxPlug.
The moment I use the release build on both, the connection works fine for a while but is very quickly interrupted (usually 2-10 seconds), FxPlug plugin gets flagged as non-responsive and is unloaded by FCP X. This behavior is erratic and may cease after some time on some machines.
We've been working on this and some other issues with FxPlug team for months and some changes have been made, but we're stuck with that one last bit.
I want to stress the following: when I use a debug version of either plugin or our app, everything works fine, fxplug is never unloaded or marked as unresponsive, the connection is stable. When both components are using release builds, it all comes apart for no apparent reason.
Both plugin and application can normally recover and reconnect after being unloaded and restored.
Any thoughts on why an xpc connection would be interrupted in this way?