UNDERTOW-1099 fix introduced a different bug which results in listeners not being called.
Thread T1 calls decrementRequests. Shutdown is false, so this thread will follow the 'else' path in preparation for decrementAndGet
Thread T2 calls shutdown. Increments from 1 to 2, sets shutdown=true, and calls decrementRequests where decrementAndGet results in 1
Thread T1 completes the decrementRequests invocation reducing the active request count to zero in the else path without calling shutdownComplete.
Flavia Rainone I don't have permissions to reopen this, would you prefer that I open a new ticket?
I would propose using a bit mask to represent both shutdownRequested and shutdownComplete to allow state changes within individual cas operations.