[flagd] Should shutdown stop the connectivity watcher? In-process leaves "Cannot invoke RPC: Channel closed!"
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia dal provider.shutdown() del resolver in-process Python e dal watcher della connettività gRPC descritto nell'issue. Riproduci lo scenario del ciclo di vita dalla suite di conformità dei provider tra linguaggi e analizza l'ordine dello shutdown. Il lavoro è completato quando lo shutdown continua a completarsi entro il suo limite senza lasciare un traceback o un log di livello ERROR del watcher.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Asking rather than reporting, because nothing required is unmet here — the shutdown completes, and well within the bound. What it leaves behind is a traceback in the host application's log, and I would like to know whether that is known and intended.
What I see
In-process resolver. After provider.shutdown():
ValueError: Cannot invoke RPC: Channel closed!
raised from gRPC's connectivity poller, after the shutdown call has already returned successfully.
The reading that fits: shutdown() closes the gRPC channel, but the watcher task observing channel connectivity is still running and calls into the closed channel on its next poll. Nothing retries and nothing fails — the provider is down by then and the application is not asking it for anything — so the only symptom is the traceback.
Why it may be worth fixing anyway
An application that shuts down cleanly still gets a stack trace on the way out. That is noise at the exact moment operators are reading logs to find out whether shutdown was clean, and it trains them to ignore tracebacks from this path — which is where a real error would also appear.
It is also the kind of thing that becomes a test failure elsewhere: a suite configured with -W error, or one asserting nothing is logged at ERROR, would fail on a provider that is behaving correctly.
Questions
- Is the watcher meant to be stopped before the channel closes, or is the traceback known and considered harmless?
- If it should be stopped — is that
shutdown()'s job, or should the watcher tolerate a closed channel and exit quietly? - Is there a reason the ordering is hard here that I am not seeing? I have not attempted a fix, because the answer to (2) decides what a fix would look like.
How I found it
Building the cross-language provider conformance suite proposed in
open-feature/spec#417. The relevant detail is that
the scenario passes — it asserts that shutdown completes within a bound, and it does. The
traceback is beside the assertion, not in it.
That is also why it went unnoticed for some time: the Python adoption had not declared the
@lifecycle capability, so the six lifecycle scenarios had never run against flagd at all. Declaring
it was a one-line change and this surfaced on the first run. The other three languages' adoptions
have been running those scenarios throughout and do not show anything equivalent, so this looks
specific to the Python in-process resolver rather than to the shape of the test.
- Lingua principale
- Python
- Stelle
- 27
- Fork
- 33
- Merge medio
- 5h
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di open-feature/python-sdk-contrib
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
UnleashProvider.track has the wrong signature: client.track raises TypeError instead of no-op Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
open-feature/python-sdk-contrib#417 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di open-feature/python-sdk-contrib
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·