canonical / pebble

Pebble is a lightweight Linux service manager with layered configuration and an HTTP API.
https://canonical-pebble.readthedocs-hosted.com/
GNU General Public License v3.0
146 stars 54 forks source link

fix: avoid need to lock state for restart.Pending() #451

Closed benhoyt closed 2 months ago

benhoyt commented 2 months ago

This change avoids the need to lock/unlock state when fetching restart.Pending(), avoiding the need for one state lock/unlock on every HTTP request. (We hope to get rid of the other lock/unlock by removing warnings, but that's a separate issue.)

Updates https://github.com/canonical/pebble/issues/366