-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
There are issues with connection management when a phase enters PhaseInstance.Status.TERMINATING state. The problems begin from the split responsibility between connection acquisition and release, combined with the stop mechanism during termination.
- PrepareHttpRequestStep - Acquires connection via
connectionPool.acquire(false, context) - SendHttpRequestStep - Sends request via
request.send(context.connection, ...)
The connection is released later when the response completes via releasePoolAndPulse()
Problem 1: Connection Acquired But Request Not Sent
This can trigger TERMINATING check before SendHttpRequestStep runs. Connection is stored in context but never used or released.
PrepareHttpRequestStep executes
↓
connectionPool.acquire() called [line 89]
↓
Connection acquired and stored in context
↓
context.accept(connection) calls session.proceed() [line 40]
↓
Session checks TERMINATING status [line 265]
↓
Session calls stop() [line 269]
↓
SendHttpRequestStep NEVER executes
↓
Connection NEVER released - LEAK!
Problem 2: Request sent but response handling interrupted
SendHttpRequestStep executes
↓
Request sent to server
↓
Response starts arriving
↓
Phase enters TERMINATING
↓
Session.proceed() checks TERMINATING [line 265]
↓
Session stops [line 269]
↓
Response handler may or may not complete
↓
releasePoolAndPulse() may or may not be called
↓
Connection may be leaked OR released
To Reproduce
#641
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working