Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: ts_middleware
-
Labels:
-
Story Points:1
-
Epic Link:
-
Sprint:TSSW Sprint - Jan 16 - Jan 30
-
Team:Telescope and Site
-
Urgent?:No
Description
The SalLogHandler is issues a large number "coroutine not awaited" messages after running unit tests. We think this is because logging is synchronous but SalLogHandler writes asynchronously, so it has to create a coroutine for each message it emits, and the fact that it uses asyncio.run_coroutine_threadsafe to do this, so that logging can be done from background threads.
Try to fix this by keeping track of unfinished concurrent.futures.Futures returned by asyncio.run_coroutine_threadsafe and closing them in the close method of SalLogHandler.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Status | To Do [ 10001 ] | In Progress [ 3 ] |
Reviewers | Wouter van Reeven [ wvreeven ] | |
Status | In Progress [ 3 ] | In Review [ 10004 ] |
Summary | SalLogHandler: eliminate "coroutine not awaited" messages at shutdown | SalLogHandler: reduce "coroutine not awaited" messages at shutdown |
Description |
The SalLogHandler is prone to issuing "coroutine not awaited" messages at shutdown, because logging is synchronous but SalLogHandler writes asynchronously, so it has to create a coroutine for each message it emits.
Fix by keeping track of those coroutines (actually concurrent.futures.Future, so threads can also log to SAL) closing unfinished ones at the end. |
The SalLogHandler is issues a large number "coroutine not awaited" messages after running unit tests. We think this is because logging is synchronous but SalLogHandler writes asynchronously, so it has to create a coroutine for each message it emits, and the fact that it uses asyncio.run_coroutine_threadsafe to do this, so that logging can be done from background threads.
Try to fix this by keeping track of unfinished concurrent.futures.Futures returned by asyncio.run_coroutine_threadsafe and closing them in the {{close}} method of {{SalLogHandler}}. |
Status | In Review [ 10004 ] | Reviewed [ 10101 ] |
Resolution | Done [ 10000 ] | |
Status | Reviewed [ 10101 ] | Done [ 10002 ] |