canonical / canonical/layer-basic

config states use hookenv.Config.changed, which can fail

Aperta
#67 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
10
Fork
42
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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()

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia da charms.layer.basic.init_config_states() e verifica come vengono attualmente rilevate le modifiche alla configurazione tramite hookenv.config(). Leggi l’utilizzo di unitdata.kv() intorno al layer di base, quindi verifica che la cache venga aggiornata solo durante init_config_states() e che le modifiche non vadano perse quando un’action viene eseguita prima di un hook di configurazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.