Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[flagd] Should shutdown stop the connectivity watcher? In-process leaves "Cannot invoke RPC: Channel closed!"

Aperta
#419 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
grpc, python
Ambito
backend

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

Needs Triage question

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

  1. Is the watcher meant to be stopped before the channel closes, or is the traceback known and considered harmless?
  2. If it should be stopped — is that shutdown()'s job, or should the watcher tolerate a closed channel and exit quietly?
  3. 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-feature/python-sdk-contrib

Tutte le issue di open-feature/python-sdk-contrib

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.