ContentFeatureSource leaks connection when Cannot reproject data, the source CRS is not available
Description
When (for whatever reason) the source CRS is not available and an exception for that is thrown, a connection is left dangling in the pool, idle in transaction. The last query on that connection was this sql made here in the app-schema plugin. Eventually the connection pool dries up.
I tried adding a reader.close() right before throwing that exception, but that didn't help. I suspect a delegated reader or something opened that connection. But I'm not really familiar with the whole stack. I hope someone else is and this rings a bell. Otherwise let me know and I’ll try to provide a more elaborate reproduction setup.
Environment
geoserver 2.22.x (2023-01-12) with geotools 28-snapshot from the same date
jdbc datasource via jndi config in tomcat
(geoserver) plugins:
inspire
app-schema
Activity
Andrea Aime
January 18, 2023 at 9:08 AM
Hum… given the situation, it seems you have a transaction going… which is strange, I guess it’s related to how app-schema manages its work… the reason of the leak may then be that the transaction is not getting closed… although I have no experience with app-schema code, so stopping speculation here.
When (for whatever reason) the source CRS is not available and an exception for that is thrown, a connection is left dangling in the pool, idle in transaction. The last query on that connection was this sql made here in the app-schema plugin. Eventually the connection pool dries up.
I tried adding a
reader.close()
right before throwing that exception, but that didn't help. I suspect a delegated reader or something opened that connection. But I'm not really familiar with the whole stack. I hope someone else is and this rings a bell. Otherwise let me know and I’ll try to provide a more elaborate reproduction setup.