It seems that a java callout class can remain instantiated even though the proxy that used it was undeployed and deleted…
My environment: Apigee Edge Private Cloud is running in GCP. I have a java callout that uses Hikari database pooling to make queries to a GCP SQL postgres database. The proxy/java callout is the only client using the database.
Here is a sequence that shows what I am seeing:
- deploy an Apigee proxy with a java callout that uses database connection pooling
- call the REST API on the proxy 15-20 times
- the postgres database reports 12 connections (max configured connections is 15)
- update the .jar file several times, save and redeploy the proxy each time
- call the REST API on the proxy 15-20 times
- the postgres database now reports 28 connections (max configured connections of 15 implies that two or more instances of the java callout class are running)
- undeploy the java-callout proxy
- the number of database connections remains at 28
- stop the database
- delete the proxy
- start the database
- the number of database connections returns to 28
- reboot Apigee edge private cloud
- the number of database connections drops to zero
Thoughts on the sequence:
-
After stopping and starting the database, it’s expected that the database pooling library would reclaim its connections (as long as the java callout class doing the connection pooling remains instantiated)
-
However, after undeploying and/or deleting a proxy with the java callout that holds those connections, I did not expect to see the connections remain in place. It seems the only way this can happen is if the java class associated with the proxy remained instantiated even after the proxy was deleted.
To me, this behavior seems like a bug. Is that the case?