Skip to content

Commit c376bab

Browse files
committed
add comment
1 parent 176775f commit c376bab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/service-library/src/servicelib/fastapi/requests_decorators.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ async def wrapper(request: Request, *args, **kwargs):
6060

6161
# Create two tasks:
6262
# one to poll the request and check if the client disconnected
63+
# sometimes canceling a task doesn't cancel the task immediately. If the poller task is not "killed" immediately, the client doesn't
64+
# get a response, and the request "hangs". For this reason, we use an event to signal the poller task to stop.
65+
# See: https://github.com/ITISFoundation/osparc-issues/issues/1922
6366
kill_poller_event = asyncio.Event()
6467
poller_task = asyncio.create_task(
6568
_disconnect_poller(kill_poller_event, request, sentinel),

0 commit comments

Comments
 (0)