Deadlock Caused by Changes in Commit 999c8ce (05.09.2024)
Issue:
Following the implementation of changes introduced in commit 999c8ce (dated 05.09.2024), a deadlock issue has been identified under high system load. Load testing of CAS revealed that the application hangs when processing 16 messages per second. The issue occurs on machines with the following configuration:
Steps to Reproduce:
Update on Deadlock Issue
After further investigation, the deadlock issue under high system load has been traced to a problem with virtual threads pinning. Specifically, the issue arises because a new virtual thread is created for each incoming request. However, these virtual threads fail to release the native threads they are pinned to, leading to thread exhaustion and causing the application to hang.
The issue can be temporarily resolved by disabling virtual threads in the configuration using the following property:
spring.threads.virtual.enabled=false.