Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-47456: Add accept wait time. #15

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading