Azure / Azure/azure-sdk-for-java
DefaultLogger writes to console synchronously which may be a problem with virtual threads
Open
Azure.Core
Client
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 2.2k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 178
Description
Quoting @anuchandy
> Another interesting learning about VirtualThreads – Logging statements in the code that runs using VirtualThreads can be problematic. Given/If each log statement does IO call, the runtime can treat it just like a normal IO call (e.g. http) and can unmount the VirtualThread instance. So, with many VirtualThreads doing logging cause runtime to spend more time in internal mount-unmount ops, and managing creation/retrieval continuations from Heap.
We should test it and look into making default logger asynchronous or virtual thread-friendly.
Contributor guide
Assessment
This issue has not been assessed yet.