-
Notifications
You must be signed in to change notification settings - Fork 409
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
ext: fix issues in net gc task #7904
Conversation
* don't run on dropping databases * don't call asyncio.wait([]) * fix wrong logging without decoding JSON
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
@@ -382,7 +387,8 @@ async def gc(server: edbserver.BaseServer) -> None: | |||
if tenant.accept_new_tasks | |||
] | |||
try: | |||
await asyncio.wait(tasks) | |||
if tasks: | |||
await asyncio.wait(tasks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't we using a TaskGroup
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess we can; this was a carried-over from an old commit, let me try again so that we know for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah it's just unnecessary, because the Task we're in here is safe without cancellation - the server doesn't need to wait for gc()
itself to clean up anything, while all child Tasks are already managed by the TaskGroup
in each Tenant (by tenant.create_task()
).
We would need an extra coroutine wrapper to use TaskGroup
here:
async def _await_task(task: asyncio.Task):
return await task
async def gc(server: edbserver.BaseServer) -> None:
while True:
try:
async with asyncio.TaskGroup() as g:
for tenant in server.iter_tenants():
if tenant.accept_new_tasks:
task = tenant.create_task(
_gc(tenant, NET_HTTP_REQUEST_TTL),
interruptable=False,
)
g.create_task(_await_task(task))
...
... looks like this doesn't fix that DROP flake though |
When in dev/test mode, dump out all the info about the other connections. Hopefully this will let us figure out where they are coming from. See also #7904
When in dev/test mode, dump out all the info about the other connections. Hopefully this will let us figure out where they are coming from. See also #7904
Refs #7888