Skip to content

Conversation

avmohan
Copy link

@avmohan avmohan commented May 15, 2024

The timed get in ResourcePool is releasing semaphore in a finally block which means it will be released even if resource was acquired successfully. Isn't the semaphore supposed to track the number of resources available in the pool?

The semaphore should only be released if a resource could not be acquired in the given time (i.e. returns null) or throws some exception. Otherwise it should not be released.

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.

1 participant