Open piotrooo opened 5 days ago
It seems to be a deadlock here:
When someone has the max pool size set to 2, and there are 3 requests, there are no available connections because the row mapper is waiting for a free connection.
I suggest moving the checking of RegisteredClient
outside the OAuth2AuthorizationRowMapper
. I think it should be checked here:
@jgrandja Just a gentle ping about this. It's occurring in our production environment and seems like a serious problem (at least to me). I can provide a PR with the fix if you confirm this issue.
Describe the bug
When I set the property
spring.datasource.hikari.maximum-pool-size=2
and try to make several parallel requests for token introspection, I receive the following exception.The response is:
Moreover, the pool connection timeout is the default 30 seconds. In addition, I added a property to detect connection leaks:
spring.datasource.hikari.leak-detection-threshold=15000
(15 seconds).As a result, some requests cannot obtain a JDBC connection.
To Reproduce
For the provided sample repository I call number of requests:
Sample
https://github.com/piotrooo/spring-auth-server-connection-leak