Skip to content

Drop Pantry locks before Volume operations#1952

Merged
jmpesp merged 1 commit into
oxidecomputer:mainfrom
jmpesp:drop_pantry_locks_before_volume_ops
Jun 23, 2026
Merged

Drop Pantry locks before Volume operations#1952
jmpesp merged 1 commit into
oxidecomputer:mainfrom
jmpesp:drop_pantry_locks_before_volume_ops

Conversation

@jmpesp

@jmpesp jmpesp commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Holding the entries lock across an activation or deactivation will lock out all other Pantry operations. If a activation or deactivation can not complete, this makes the Pantry un-usable.

Drop the mutex guards before long-running operations.

Also: in the Pantry implementation, re-implement attach in terms of attach_activate_background, which already does the activation in the background and drops the entries lock. However callers of attach expect the Volume to be activated when the call returns so wait for the background job.

Co-authored-by: Alan alan@oxide.computer

Fixes #1945.

Holding the `entries` lock across an activation or deactivation will
lock out _all_ other Pantry operations. If a activation or deactivation
can not complete, this makes the Pantry un-usable.

Drop the mutex guards before long-running operations.

Also: in the Pantry implementation, re-implement `attach` in terms of
`attach_activate_background`, which already does the activation in the
background and drops the `entries` lock. However callers of `attach`
expect the Volume to be activated when the call returns so wait for the
background job.

Co-authored-by: Alan <alan@oxide.computer>

Fixes oxidecomputer#1945.
@jmpesp jmpesp requested a review from leftwo June 23, 2026 00:10

@leftwo leftwo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like the pantry test in here as well, but I can add that in a follow up PR.

@jmpesp jmpesp merged commit 2a9e74d into oxidecomputer:main Jun 23, 2026
17 checks passed
@jmpesp jmpesp deleted the drop_pantry_locks_before_volume_ops branch June 23, 2026 21:50
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.

The pantry holds locks while waiting for activation and/or deactivation

2 participants