Skip to content

Conversation

lovetodream
Copy link
Contributor

When connections are requested from the pool in bursts, the pool might have requests in the queue while a keep alive or idle timer is triggered. This should resolve the issue, closes #472.

Currently, I've only implemented a test case to reproduce the behaviour. (The test case is a bit verbose atm, but I wanted to include the full picture for now)
One way to fix it would be to check the request queue in PoolStateMachine.connectionKeepAliveTimerTriggered(_:) and PoolStateMachine.connectionIdleTimerTriggered(_:) instead of a precondition. This can be archived by calling PoolStateMachine.handleAvailableConnection(index:availableContext:) if the queue is not empty.
Maybe this should be handled in ConnectionPool instead?

Let me know what you think @fabianfett

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConnectionPool crash on keepalive with non-empty request queue
2 participants