clarify async taskgroup behavior

Agent-Logs-Url: https://github.com/rudolf1/brencher/sessions/9e719b58-ad2a-4eca-99bf-43c750f71a72

Co-authored-by: rudolf1 <5525769+rudolf1@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-19 19:36:56 +00:00
committed by GitHub
co-authored by rudolf1
parent 1acea85934
commit b2782ee220
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -111,7 +111,7 @@ class App:
timeout = 5 if has_error else 60
try:
await asyncio.wait_for(self.environment_update_event.wait(), timeout=timeout)
except TimeoutError:
except asyncio.TimeoutError:
pass
self.environment_update_event.clear()
@@ -149,6 +149,7 @@ class App:
self.web_app = web_app
self.emit_callback = web_app.emit_envs
try:
# Keep processing and web serving coupled so shutdown or fatal failure tears down the whole app.
async with asyncio.TaskGroup() as task_group:
task_group.create_task(self.processing_loop())
task_group.create_task(self._run_web_server(web_app))
+1 -1
View File
@@ -235,6 +235,6 @@ class WebApp:
if self._server is None:
return
if self._event_loop is not None and self._event_loop.is_running():
self._event_loop.call_soon_threadsafe(setattr, self._server, "should_exit", True)
self._event_loop.call_soon_threadsafe(lambda: setattr(self._server, "should_exit", True))
else:
self._server.should_exit = True