[Bug]: Callback Management
Created from https://github.com/apple/container/issues/167.
I have done the following
- [x] I have searched the existing issues
- [ ] If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
Not applicable.
Current behavior
Callback Management
- Completion handlers are used throughout the XPC communication
- There's potential for callbacks to be invoked in unexpected order
- Some callbacks may never be called if a race condition occurs
Expected Behavior
Callback Invocation
- Each callback should be invoked exactly once
- Callbacks should occur even if the connection is terminated
- Proper timeout and cancellation handling
Ordered Execution
- Operations with dependencies should be executed in the correct order
- Results should be delivered in a predictable sequence
- Long-running operations shouldn't block critical path operations
Environment
Not applicable.
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
@dcantah Will cont.resume() crash when we hit a timeout and execute group.cancelAll() first in XPCClient.send()?
@crosbymichael Should we preserve execution order when calling handleMessage() in XPCServer.handleClientConnection()?
@dkovba Do you mean preserve ordering in terms of submitting the item for execution or the responses as well?
@crosbymichael It seems we currently add tasks in the order the objects are received, but their execution and replies may happen in any order, and replies can arrive out of order. Likely, there is nothing wrong with this.
I agree, I think the current flow is correct for a server component.
Going to close this out, but if we find specific examples of places we have an issue we can open them with more details.