Can snapctl be accessed concurrently from two snaps

I have two snaps that have snapd declaration. Both snaps run daemons. Using REST API’s one snap performs snap install / uninstall and other pets system watchdog.

Wondering if there will be any issues when snapd / snapctl is accessed concurrently by daemons of both snaps.

if they do orthogonal things or touch different snaps it should be ok. otherwise snapd has extensive logic to try to detect conflicts between operations, you might get 409 conflict errors from the api endpoints and need to retry or fail as appropriate

I have bunch of snaps that have snapd-control declaration with them which do things like:

  1. Install / uninstall snaps (Snap A)
  2. List installed snaps (Snap B)
  3. Pet watchdog (Snap C)
  4. List interfaces in the system (Snap D)

Each one of above op is done by distinct snaps. So, I believe these are orthogonal operations and I should be fine. Right?

Yes, as long as you retry when the snapd API returns HTTP status code 409 for conflicts everything will work for separate apps to use the API concurrently.

1 Like

Thanks for confirming @ijohnson