aviflax / vax.help

BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

DB connections are not replaced/reopened if they die/close #31

Open aviflax opened 3 years ago

aviflax commented 3 years ago

We should probably use some kind of connection pool.

aviflax commented 3 years ago

I found this in the webserver logs:

{"mulog/trace-id":"4bOml4JXXY-8ciwZd22w5XTT580bk-66","mulog/timestamp":1618607303654,"mulog/event-name":"vax.help.web.server/sub-verification-req-err","mulog/namespace":"clojure.core","exception":"org.postgresql.util.PSQLException: This connection has been closed.\n\tat org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:857)\n\tat org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1763)\n\tat org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:410)\n\tat next.jdbc.prepare$create.invokeStatic(prepare.clj:136)\n\tat next.jdbc.prepare$create.invoke(prepare.clj:86)\n\tat next.jdbc.result_set$eval3134$fn__3139.invoke(result_set.clj:854)\n\tat next.jdbc.protocols$eval2059$fn__2060$G__2048__2069.invoke(protocols.clj:33)\n\tat next.jdbc$execute_one_BANG_.invokeStatic(jdbc.clj:260)\n\tat next.jdbc$execute_one_BANG_.invoke(jdbc.clj:244)\n\tat vax.help.subscription$get_by_nonce.invokeStatic(subscription.clj:16)\n\tat vax.help.subscription$get_by_nonce.invoke(subscription.clj:14)\n\tat vax.help.web.server$subscription_deactivation.invokeStatic(server.clj:305)\n\tat vax.help.web.server$subscription_deactivation.invoke(server.clj:293)\n\tat vax.help.web.server$app.invokeStatic(server.clj:368)\n\tat vax.help.web.server$app.invoke(server.clj:360)\n\tat org.httpkit.server.HttpHandler.run(RingHandler.java:117)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base/java.lang.Thread.run(Thread.java:834)\n"}