canonical / canonical/layer-basic

Multiple calls to unitdata.kv().flush()

Open
#68 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10
Forks
42
PR merge metrics
No merged PRs in 30d

Description

charms.layer.basic.clear_config_states() calls unitdata.kv().flush(), which will be the second time the storage is flushed in the hook. In the perverse case where a failure happens between these two calls, we can end up with invalid state.

I think this is a use case for an actual `@cleanup` phase in charms.reactive, per https://github.com/juju-solutions/charms.reactive/pull/20

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.