Ensure error propagation for MessageChannel::Send is complete
Categories
(Core :: IPC, task)
Tracking
()
People
(Reporter: jstutte, Assigned: jstutte)
References
Details
Attachments
(2 obsolete files)
MessageChannel::Send
is meant to inform the caller if the message dispatching was successful. We need to ensure that all possible error conditions we can encounter down the road are correctly propagated, otherwise callers might block, expecting answers they will never get.
Examples of missing propagation (might not be exhaustive):
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
There might be more of this inside Node::SendUserMessageInternal
, in case for a second patch.
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
And we might want to have a patch to update all uses of MessageLink::SendMessage
.
Comment 5•3 years ago
|
||
We actually intentionally don't report deeper errors to the user for calls to MessageChannel::Send
. For an actor, when sending an async message to the other side, there's no reasonable way to respond to the send failure, and in the event the other side disconnects (e.g. due to crashing or some other kind of error), the message can always be dropped, even if the method returns true. The only reason we really want to return an error there is for a reason under the user's control i.e. after the actor itself has already been destroyed, so CanSend()
returns false.
We do need to report connection errors for sync messages, because the caller does have the ability to observe them failing, and needs to handle the fact that no response was received.
Reporting an error from Send
could also give the misleading impression that if it returns true, the message will be delivered, which is not the case as every step of the message sending process could lead to it being dropped. If the user needs to react to the child process disappearing, they can use async returns
messages and handle the error case, or also watch in ActorDestroy
for the actor to be destroyed.
Comment 6•3 years ago
|
||
Comment on attachment 9282068 [details]
Bug 1775025 - Remove obsolet MessageChannel::Begin/StopPostponingSends feature. r?#ipc-reviewers
Revision D149775 was moved to bug 1775112. Setting attachment 9282068 [details] to obsolete.
Updated•3 years ago
|
Updated•3 years ago
|
Description
•