NCEAS / metadig-engine

MetaDig Engine: multi-dialect metadata assessment engine
7 stars 5 forks source link

metadig-controller intermittent error #213

Closed gothub closed 5 years ago

gothub commented 5 years ago

Intermittent error for metadig-engine with the resulting log msg:

org.postgresql.util.PSQLException: ERROR: query_wait_timeout
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
...
        at org.postgresql.Driver.connect(Driver.java:256)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:208)
        at edu.ucsb.nceas.mdqengine.store.DatabaseStore.init(DatabaseStore.java:82)
        at edu.ucsb.nceas.mdqengine.store.DatabaseStore.<init>(DatabaseStore.java:54)
        at edu.ucsb.nceas.mdqengine.store.StoreFactory.getStore(StoreFactory.java:16)
        at edu.ucsb.nceas.mdq.rest.RunsResource.<init>(RunsResource.java:36)

This appears to be a problem with the controller holding on to a database connection to long, as the connection pooler will close the connection. Polling the connection to wake it up doesn't work in this case, as the connection no longer exists. The best option is to close the connection after each service request.

gothub commented 5 years ago

The fix was implemented in the metadig-webapp repo, with commit 46901c5f14c719b937f606950349d89d14345da2