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.