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

Add 20% jitter to net worker sleep #7915

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions edb/server/net_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import asyncio
import logging
import base64
import random

from edb.ir import statypes
from edb.server import defines
Expand Down Expand Up @@ -132,9 +133,10 @@ async def http(server: edbserver.BaseServer) -> None:
except Exception as ex:
logger.debug("HTTP worker failed", exc_info=ex)
finally:
await asyncio.sleep(
POLLING_INTERVAL.to_microseconds() / 1_000_000.0
jittered_polling_interval = (
POLLING_INTERVAL.to_microseconds() * random.uniform(0.8, 1.2)
)
await asyncio.sleep(jittered_polling_interval / 1_000_000.0)


@dataclasses.dataclass
Expand Down
Loading