Sometimes the service manager has to write a task log, but there's a
3-way deadlock where another goroutine has held the state lock. Break
this cycle.
See https://github.com/canonical/pebble/issues/314 -- either this PR or #355 by itself will fix that issue.
I'm not sure about this PR. I like what it's trying to achieve, but it also
begs the question: why do we have this one special fine-grained lock
for the task log, and not for all the other fields?
Closing in favour of https://github.com/canonical/pebble/pull/359, which is much less invasive, and it seems a better approach to structure the locking better rather than do surgery to the state package.
Sometimes the service manager has to write a task log, but there's a 3-way deadlock where another goroutine has held the state lock. Break this cycle.
See https://github.com/canonical/pebble/issues/314 -- either this PR or #355 by itself will fix that issue. I'm not sure about this PR. I like what it's trying to achieve, but it also begs the question: why do we have this one special fine-grained lock for the task log, and not for all the other fields?