Skip to content

Commit e67c29b

Browse files
committed
fix: Trim two comments on the data source shutdown and retry wiring
Addresses review feedback on #519. AsyncPollingUpdateProcessor.stop() now carries one line saying why it waits before closing the transport. The previous wording read as if the processor kept working after OFF, when it is shutting down. The comment on the bare RetryDelayStrategy keeps only the fact a reader needs: the strategy must be passed, or the SSE client picks its own backoff.
1 parent c0000b6 commit e67c29b

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

‎ldclient/impl/aio/transport.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ def create(self, url: str, initial_retry_delay: float, query_params=None, sdk_ma
141141
aiohttp_request_options["proxy"] = proxy
142142
if sdk_managed_retry:
143143
# The SSE client's retry is disabled; the SDK owns the delay. The base
144-
# strategy returns the delay unchanged, so the wait is always zero;
145-
# omitting it would select the library's own backoff.
144+
# strategy must be passed: omitting it selects the library's backoff.
146145
retry_options: dict = {
147146
"initial_retry_delay": 0,
148147
"retry_delay_strategy": RetryDelayStrategy(),

‎ldclient/impl/datasource/async_polling.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ async def stop(self):
6363
if self._data_source_update_sink is not None:
6464
self._data_source_update_sink.update_status(DataSourceState.OFF, None)
6565

66-
# OFF is reported first, so a listener sees the shutdown at once. The wait
67-
# that follows only drains a poll already in flight, so the transport is
68-
# not closed while that request still uses it. The close is in a finally,
69-
# so an owned transport is released even if stop() is cancelled mid-wait.
66+
# Do not close the transport while an in-flight request still uses it.
7067
try:
7168
await self._task.wait_stopped()
7269
finally:

‎ldclient/impl/datasource/streaming.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ def _create_sse_client(self) -> SSEClient:
141141
),
142142
error_strategy=ErrorStrategy.always_continue(), # we'll make error-handling decisions when we see a Fault
143143
# The SSE client's retry is disabled; the SDK owns the delay. The base
144-
# strategy returns the delay unchanged, so the wait is always zero;
145-
# omitting it would select the library's own backoff.
144+
# strategy must be passed: omitting it selects the library's backoff.
146145
initial_retry_delay=0,
147146
retry_delay_strategy=RetryDelayStrategy(),
148147
retry_delay_reset_threshold=0,

0 commit comments

Comments
 (0)