Skip to content

fix(rpc): mark panicked async operations as failed#466

Open
ouicate wants to merge 1 commit into
zcash:mainfrom
ouicate:fix/ghost-operations-on-panic
Open

fix(rpc): mark panicked async operations as failed#466
ouicate wants to merge 1 commit into
zcash:mainfrom
ouicate:fix/ghost-operations-on-panic

Conversation

@ouicate

@ouicate ouicate commented Jun 10, 2026

Copy link
Copy Markdown

Summary

  • Fixes GHSA-582c-4hqf-53q3: when a Tokio task spawned by AsyncOperation::new panics, the operation is now transitioned to failed instead of remaining stuck in executing forever.
  • A companion task awaits the operation JoinHandle and records a Misc RPC error if the task panicked, so z_getoperationstatus and z_getoperationresult behave correctly and ghost operations can be pruned.
  • Adds unit tests covering panicking and successful async operations.

When a Tokio task spawned by AsyncOperation::new panics, the operation
state was never updated from Executing. Ghost operations then persisted
indefinitely because z_getoperationresult only prunes terminal states.

Await the spawned task's JoinHandle in a companion task and record a
Failed result if the task panicked, so clients can observe and prune
the operation normally.

Co-Authored-By: Cursor <noreply@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant