Open bkonyi opened 1 month ago
@rmacnak-google can you think of any reason why this wouldn't be feasible or would otherwise be a bad idea?
Seems reasonable. We'd need to make sure we're only waiting to finish the pending outgoing responses and not accepting new requests or we risk never actually reaching shutdown.
It's possible for the VM to shutdown immediately after the main isolate returns from a service extension if there's no longer any events in the queue and no ports remain open. This can cause a race where the VM starts to shutdown as the service isolate is in the middle of processing the service extension response, preventing the VM service client from actually getting the service extension result.
We should investigate whether or not it's possible to prevent the service isolate from shutting down while it's in the middle of processing a response.