Skip to content

Commit

Permalink
cache_streaming: increase subscriber wait for provider timeout to max…
Browse files Browse the repository at this point in the history
…imum 0.315s
  • Loading branch information
Bodong-Yang committed Aug 6, 2024
1 parent fb73bb8 commit edfb459
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ota_proxy/cache_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class CacheTracker:
finish the caching.
"""

SUBSCRIBER_WAIT_PROVIDER_READY_MAX_RETRY = 3
SUBSCRIBER_WAIT_MAX_RETRY = 16
SUBSCRIBER_WAIT_PROVIDER_READY_MAX_RETRY = 6 # 0.315s
SUBSCRIBER_WAIT_NEXT_CHUNK_MAX_RETRY = 16 # 9s
SUBSCRIBER_WAIT_BACKOFF_FACTOR = 0.01
SUBSCRIBER_WAIT_BACKOFF_MAX = 1
FNAME_PART_SEPARATOR = "_"
Expand Down Expand Up @@ -221,7 +221,7 @@ async def _subscriber_stream_cache(self) -> AsyncIterator[bytes]:

# no data chunk is read, wait with backoff for the next
# data chunk written by the provider.
if err_count > self.SUBSCRIBER_WAIT_MAX_RETRY:
if err_count > self.SUBSCRIBER_WAIT_NEXT_CHUNK_MAX_RETRY:
# abort caching due to potential dead streaming coro
_err_msg = f"failed to stream({self.meta=}): timeout getting data, partial read might happen"
logger.warning(_err_msg)
Expand Down

0 comments on commit edfb459

Please sign in to comment.