canonical / canonical/layer-basic
config states use hookenv.Config.changed, which can fail
- 主要言語
- Python
- スター
- 10
- フォーク
- 42
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
The config states detect if a configuration item has changed using hookenv.config() and its changed method. This was designed assuming the only thing running in a hook context is a hook, which is now untrue. It is possible for an action to be invoked, which can check charm configuration using hookenv.config() and will flag changed config items as seen. If this action happens to be called between the config being changed and an actual hook being called (such as config-changed), then the configuration changed states will be lost.
The solution is for the base layer to cache the config itself in unitdata.kv(), so the cache only gets updated in charms.layer.basic.init_config_states()
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
charms.layer.basic.init_config_states() から開始し、現在 hookenv.config() を通じて設定変更がどのように検出されているかを調べます。ベースレイヤー周辺での unitdata.kv() の使用を読み、その後、キャッシュが init_config_states() の実行中にのみ更新されること、および設定フックの前に action が実行された場合に変更が失われないことを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100