FlagdProvider default keep_alive_time=0 causes GOAWAY crash with flagd server
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- backend, networking
Direzione di ricerca
Inizia in config.py, in corrispondenza di DEFAULT_KEEP_ALIVE, e in grpc.py, in corrispondenza di _generate_channel(), quindi esamina come i tipi di resolver IN_PROCESS e RPC costruiscono i propri canali. Scegli se aumentare il valore predefinito o omettere l’opzione keepalive quando il valore è zero. Il lavoro è completato quando il valore predefinito non causa più ping immediati, GOAWAY o il crash ARM segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
The FlagdProvider defaults keep_alive_time to 0 (DEFAULT_KEEP_ALIVE = 0 in config.py), which is passed directly to grpc.keepalive_time_ms as a channel option.
In the Python gRPC C-core implementation, keepalive_time_ms=0 is interpreted as "send pings immediately / every ~1ms" rather than "disabled". This causes flagd's Go gRPC server to reject the connection with:
GOAWAY [ENHANCE_YOUR_CALM] "too_many_pings"
flagd's Go gRPC server uses the default grpc-go enforcement policy with MinPingInterval=5min. Any keepalive interval below 5 minutes triggers the GOAWAY.
Impact
- On aarch64/ARM (e.g., Raspberry Pi), the GOAWAY triggers a fatal gRPC C-core assertion failure in
ev_epoll1_linux.cc:Check failed: next_worker->state == KICKED— crashing the entire Python process - On x86_64, the client typically reconnects but logs repeated GOAWAY warnings, degrading performance and reliability
This affects both the IN_PROCESS and RPC resolver types since both create gRPC channels with the same keepalive options.
Reproduction
from openfeature.contrib.provider.flagd import FlagdProvider
from openfeature.contrib.provider.flagd.config import ResolverType
# Default keep_alive_time=0 → immediate crash/GOAWAY with flagd server
provider = FlagdProvider(
host="flagd",
port=8015,
resolver_type=ResolverType.IN_PROCESS,
)
flagd server logs:
Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug data equal to "too_many_pings"
Client crash (ARM only):
F0000 00:00:1773608949.106482 38 ev_epoll1_linux.cc:1125] Check failed: next_worker->state == KICKED
Suggested Fix
Change the default from 0 to a value that respects flagd's server-side MinPingInterval of 5 minutes:
# config.py
DEFAULT_KEEP_ALIVE = 600000 # 10 minutes (ms) — above flagd's 5min MinPingInterval
Or alternatively, don't set grpc.keepalive_time_ms at all when keep_alive_time=0, letting the gRPC library use its own default (which is "infinite" / disabled in the C-core):
# grpc.py - _generate_channel()
options = []
if config.keep_alive_time > 0:
options.append(("grpc.keepalive_time_ms", config.keep_alive_time))
Workaround
Set keep_alive_time explicitly when creating the provider:
provider = FlagdProvider(
host="flagd",
port=8015,
resolver_type=ResolverType.IN_PROCESS,
keep_alive_time=600000, # 10 minutes
)
Or via environment variable:
FLAGD_KEEP_ALIVE_TIME_MS=600000
Environment
openfeature-provider-flagdversion: 0.2.7- flagd version: v0.13.2
- Python: 3.11 (aarch64-linux-gnu)
- grpcio: compiled with C-core (not pure-Python)
- Platform: Raspberry Pi 5 (ARM64)
- 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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
gradio-app/gradio#13895 ·
-
build-error
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
spack/spack-packages#6713 ·
-
Use issue templates Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ActivityWatch/activitywatch#1464 · 1 reazione ·
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search results Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bytedance/trae-agent#483 ·