Skip to content

Commit

Permalink
fix retry_interval: set it to 1 second instead of 1000 seconds (#14357)
Browse files Browse the repository at this point in the history
* fix retry_interval: set it to 1 second instead of 1000 seconds

This looks like it was a typo introduced in Azure/azure-sdk-for-python#5785 (review)
The review comment makes me think the author meant 1 second, but maybe thought it was milliseconds.
time.sleep and asyncio.sleep arguments are both in seconds

in #14067 we are experiencing timeouts after ~15 to 16 min (matching 1000 seconds) that are not solved by configuring timeouts in the client

* fix another hardcoded trio.sleep(1000)
  • Loading branch information
vbarbaresi authored Nov 9, 2020
1 parent 7c7fb98 commit 12ab9f7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def __len__(self):
async def __anext__(self):
retry_active = True
retry_total = 3
retry_interval = 1000
retry_interval = 1 # 1 second
while retry_active:
try:
chunk = await self.response.internal_response.content.read(self.block_size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async def __anext__(self):
loop = _get_running_loop()
retry_active = True
retry_total = 3
retry_interval = 1000
retry_interval = 1 # 1 second
while retry_active:
try:
chunk = await loop.run_in_executor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __iter__(self):
def __next__(self):
retry_active = True
retry_total = 3
retry_interval = 1000
retry_interval = 1 # 1 second
while retry_active:
try:
chunk = next(self.iter_content_func)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def __anext__(self):
if retry_total <= 0:
retry_active = False
else:
await trio.sleep(1000)
await trio.sleep(1)
headers = {'range': 'bytes=' + str(self.downloaded) + '-'}
resp = self.pipeline.run(self.request, stream=True, headers=headers)
if resp.status_code == 416:
Expand Down

0 comments on commit 12ab9f7

Please sign in to comment.