re-deployment woes with stale DB pools

38 views
Skip to first unread message

Webdev Tory Anderson

unread,
Nov 7, 2018, 11:56:46 AM11/7/18
to Immutant
  I've been thrilled by the ability to just drop my application war files into the Wildfly directory and have something like 0-downtime deployment. That is, until recently, when my deployments fail until I restart Wildfly. Judging by my logs, its a postgres error about failure to create a connection (I'm using hikari-cp for pooling). I currently believe (after sniffing around for all sorts of explanations) it's the application failing to close its connection when one war is replaced with another, and the deployment fails until the designated time-out for the pool connection is met. I'm not sure whether this timeout depends upon Postgres settings or the connection settings I define within the app. In any case, assuming the error logs are correct in relaying errors from Postgresql, how can I improve my deployment process to alleviate this error? Should I be trying to define some tear-down that Immutant/Wildfly will perform, or changing my connection settings, or changing my database settings?

For what it's worth, here are my connection settings (mostly default):

#+BEGIN_SRC clojure
    {:database-name "dbname"
     :adapter "postgresql"
     :auto-commit true
     :register-mbeans false
     :password "pass"
     :port-number 5432
     :username "name"
     :max-lifetime 1800000
     :minimum-idle 10
     :connection-timeout 30000
     :server-name "db.server.com"
     :read-only false
     :maximum-pool-size 10
     :idle-timeout 600000
     :validation-timeout 5000
     :pool-name "db_pool"}
#+END_SRC

Webdev Tory Anderson

unread,
Feb 26, 2019, 1:55:02 PM2/26/19
to Immutant
I'm still floundering on this one, and I'm afraid I don't know which forum to ask my question on so I'll ask here: I deploy my application by dropping the war file into my wildfly standalone deployments directory. It works. Now I have an updated version of my application, which I swap in-place for the old .war file. When I re-deploy this way, does any tear-down occur from Wildfly or Immutant? Is there a way for me to change my process so tear-down occurs to disconnect my db pool?
Reply all
Reply to author
Forward
0 new messages