Details
-
Bug
-
Resolution: Done
-
Major
-
1.4.16.Final
-
None
-
None
Description
Given the GracefulShutdownHandler#decrementRequests function!
private void decrementRequests() { long active = activeRequestsUpdater.decrementAndGet(this); // A if (shutdown) { synchronized (lock) { if (active == 0) { shutdownComplete(); } } } }
A thread T1 is at A. During this instant:
- A thread T2 handles a new request GracefulShutdownHandler#handleRequest
- A thread T3 shutdown the handler GracefulShutdownHandler#shutdown() but after T2 has started to handle its request (ie. after the if (shutdown) condition.
In this case even if there is an active request, T0 will call shutdownComplete()
Attachments
Issue Links
- causes
-
UNDERTOW-1701 GracefulShutdownHandler has race condition that results in shutdownComplete not called
- Resolved