[BUG] Configuration subscription stops permanently after the daprd sidecar restarts
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 68/100
Rechercherichtung
Start in dapr/clients/grpc/_response.py with ConfigurationWatcher, then trace subscribe_configuration() in both dapr.clients.DaprClient and dapr.aio.clients.DaprClient. Reproduce the stream failure by restarting daprd, and verify that both subscription paths recover and deliver later updates without restarting the application.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Expected Behavior
DaprClient.subscribe_configuration() keeps delivering configuration updates for the lifetime of the client.
If the daprd sidecar process exits and comes back (for example an OOM kill of the sidecar container while the application container keeps running), the SDK should re-establish SubscribeConfigurationAlpha1 against the new sidecar and continue calling the handler. Updates that happened while the sidecar was down should be visible on the new subscription, or the application should at least be able to observe that the previous stream ended.
Unary calls such as get_configuration() already work again once the new sidecar is listening. The long-lived configuration subscription should recover the same way.
Actual Behavior
The subscription works after a fresh application start. After daprd restarts, the handler is never called again. The application process stays healthy, so a Kubernetes pod is not recreated, and dynamic config updates are silently lost until the application process itself restarts.
ConfigurationWatcher in dapr/clients/grpc/_response.py reads SubscribeConfigurationAlpha1 on a daemon thread. When the stream raises, the thread prints to stdout and returns:
except Exception:
print(f'{self.store_name} configuration watcher for keys {self.keys} stopped.')
pass
There is no retry. subscribe_configuration() does not retain the ConfigurationWatcher, so nothing is left to start a new stream. The failure is not reported through the Python logger, and the returned subscription id belongs to the dead sidecar.
Seen with dapr Python SDK 1.18.3. Both dapr.clients.DaprClient.subscribe_configuration and dapr.aio.clients.DaprClient.subscribe_configuration use this watcher.
Steps to Reproduce the Problem
- Run an app with a
configuration.rediscomponent and the Python SDK 1.18.3. - Subscribe once at startup:
from dapr.clients import DaprClient
def handler(subscription_id, response):
print("update", subscription_id, {k: v.value for k, v in response.items.items()})
with DaprClient() as client:
subscription_id = client.subscribe_configuration(
store_name="configstore",
keys=["my-key"],
handler=handler,
)
print("subscribed", subscription_id)
# keep the process alive
- Confirm a config change invokes
handler. - Restart only daprd. In Kubernetes this is a sidecar OOM (
OOMKilled) while the app container keeps the same process. Locally, stop and start thedaprdprocess without restarting the app. - Change
my-keyagain after daprd is healthy.
handleris not called. Stdout may contain{store} configuration watcher for keys [...] stopped.Recreating the app process makes updates work again until the next sidecar restart.
Release Note
RELEASE NOTE: FIX Reconnect configuration subscriptions after the Dapr sidecar stream drops.
- Vorherrschende Sprache
- Python
- Sterne
- 272
- Forks
- 152
- Ø Merge
- 2 T. 22 Std.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus dapr/python-sdk
-
dapr-ext-workflow good first issue kind/enhancement P2
Schwierigkeit 2/5 1-2 Tage Anfängerfreundlichkeit 72/100
dapr/python-sdk#853 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
[WORKFLOW SDK FEATURE REQUEST] Retry WaitForInstanceCompletion/Start on a server-sent CANCELLEDOffendapr-ext-workflow kind/enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
dapr/python-sdk#1246 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
kind/bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 65/100
dapr/python-sdk#1233 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
kind/bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
dapr/python-sdk#1230 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
dapr-ext-workflow kind/enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 78/100
dapr/python-sdk#1213 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in dapr/python-sdk
Ähnliche Issues
-
ACK_WAITING HELP_WANTED UPDATE_CS
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
OWASP/CheatSheetSeries#2458 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
BasedHardware/omi#19711 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Qwen3_5MoeModel no longer returns router_logits, breaking aux loss with output_router_logits=TrueOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
huggingface/transformers#49172 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
vllm-project/vllm-metal#885 ·
Maintainer antworten meist innerhalb von 1 Tag