Skip to content

Clean Shutdown of Servo #30849

@gterzian

Description

@gterzian

Requires further investigation, but some initial notes:

  1. Pipeline doesn't wait on an ACK from script when sending the ExitPipeline msg.
  2. Neither does an EventLoop wait on an ACK from script when sending the ExitScriptThread msg
  3. There is some workflow with the BHM involving a closing boolean, which is useful if the script-thread is blocking inside a script execution, however it's not good enough to ensure clean shutdown, because a script-thread could easily be already handling a message by the time it is set. The constellation does wait on an ACK from the BHM, which implies that the closing flag has been set, however that doesn't prevent script from handling one last message if past the point of checking the flag(it may be that the constellation sends it's reply to the IPC, and then shutdowns before script is scheduled to receive it).

Any way, requires more investigation, but looking at the panic in #24066 it seems clear that the problem is not that the IPC returns None, it's that it returns an error because the sender has already been dropped(such as Io(Custom { kind: ConnectionReset, error: "No senders exist for this port." }) or in Disconnected in #27146).

The last issue linked above #22154 appears unrelated actually(a comment in the issue seems to correctly identify a separate problem with trying to send a message layout after it has shutdown).

Originally posted by @gterzian in #27171 (comment)

Sub-issues

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions