Skip to content

Commit

Permalink
Merge pull request #15 from lsst-dm/tickets/DM-47456
Browse files Browse the repository at this point in the history
DM-47456: Add accept wait time.
  • Loading branch information
ktlim authored Nov 7, 2024
2 parents e117c22 + d0b9d50 commit 57e1aa9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/s3daemon/s3daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
connect_timeout = float(os.environ.get("S3DAEMON_CONNECT_TIMEOUT", 5.0))
max_retries = int(os.environ.get("S3DAEMON_MAX_RETRIES", 2))
max_clients = int(os.environ.get("S3DAEMON_MAX_CLIENTS", 25))
accept_wait = float(os.environ.get("S3DAEMON_ACCEPT_WAIT", 0.001))

config = botocore.config.Config(
max_pool_connections=max_connections,
Expand Down Expand Up @@ -133,7 +134,7 @@ async def go():
break
except (TimeoutError, BlockingIOError):
# Allow other tasks to run.
await asyncio.sleep(0)
await asyncio.sleep(accept_wait)
task = asyncio.create_task(handle_client(client, conn))
# Add to set to avoid premature cleanup.
background_tasks.add(task)
Expand Down

0 comments on commit 57e1aa9

Please sign in to comment.