snapd icon indicating copy to clipboard operation
snapd copied to clipboard

cmd/snap: run inhibition flow in goroutine

Open ZeyadYasser opened this issue 1 year ago • 3 comments

This avoids the deadlock scenario:

  • snap run holds inhibition lock.
  • snapd holds state lock (link-snap).
  • snapd tries to hold inhibition lock but waits for snap run to release lock.
  • snap run calls the REST API (i.e. for notices, connections) which tries to hold state lock.
  • snap run is now waiting for snapd to release state lock (to send the notice) and snapd is waiting for snap run to release the inibition lock.
  • we have a deadlock and snapd state is locked.

Running inhibition flow in a goroutine allows snap run to release the inhibition lock.

Fixes: https://bugs.launchpad.net/snapd/+bug/2084730

ZeyadYasser avatar Oct 24 '24 13:10 ZeyadYasser

@bboozzoo @pedronis @ZeyadYasser should we close this PR and focus on the state unlocker PR?

Meulengracht avatar Nov 07 '24 08:11 Meulengracht

Blocked by decision.

ernestl avatar Nov 21 '24 05:11 ernestl

This is not important for 2.67, We decided to remove this from 2.67 and rather release as .x or 2.68.

ernestl avatar Nov 22 '24 09:11 ernestl