Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime/src/enclave_rpc/client: Fix panic on drop in async context #5917

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

peternose
Copy link
Contributor

The graceful shutdown of active sessions was removed, as they should not be closed when the RPC client is dropped. Instead, we should explicitly invoke the appropriate functions.

Reasons:

  • Blocking is not acceptable because drops should be fast, and sessions should be closed asynchronously.
  • Spawning a new task is also not acceptable since drops should (mostly) be deterministic. There could be issues if the code following an implicit drop call relies on sessions being closed (not a problem yet).
  • If the Tokio runtime stops and the async tasks spawned during the drop haven't completed, they will be destroyed without being executed.

The graceful shutdown of active sessions was removed, as they should
not be closed when the RPC client is dropped. Instead, we should
explicitly invoke the appropriate functions.
Copy link

netlify bot commented Oct 22, 2024

Deploy Preview for oasisprotocol-oasis-core canceled.

Name Link
🔨 Latest commit cd0f3be
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-oasis-core/deploys/6717ab376dadd70008de1b19

@kostko kostko linked an issue Oct 22, 2024 that may be closed by this pull request
@peternose peternose added the c:bug Category: bug label Oct 22, 2024
@peternose peternose merged commit 013c51e into master Oct 22, 2024
3 of 5 checks passed
@peternose peternose deleted the peternose/bugfix/rpc-client-panic branch October 22, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:bug Category: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop for EnclaveRPC client panics in async context
2 participants