This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-14
Channels
- # atom-editor (5)
- # babashka (6)
- # beginners (29)
- # calva (16)
- # cider (1)
- # clj-kondo (20)
- # cljs-dev (44)
- # clojure (29)
- # clojure-europe (19)
- # clojure-nl (8)
- # clojure-norway (7)
- # clojure-spec (2)
- # clojure-sweden (1)
- # clojure-uk (56)
- # clojurescript (32)
- # code-reviews (30)
- # conjure (24)
- # cursive (49)
- # datomic (4)
- # fulcro (31)
- # helix (3)
- # instaparse (4)
- # kaocha (100)
- # lambdaisland (2)
- # mid-cities-meetup (1)
- # monads (1)
- # off-topic (42)
- # pathom (13)
- # pedestal (6)
- # portal (5)
- # re-frame (6)
- # reagent (9)
- # reitit (11)
- # remote-jobs (1)
- # rewrite-clj (11)
- # shadow-cljs (44)
- # sql (22)
- # tools-deps (13)
- # uncomplicate (1)
- # xtdb (15)
i’m pretty sure i’m using with*
etc the way i should which should dispose of my connections properly without manual intervention but i now hit a threshold somehow that i can’t even run my tests without getting the following error. in the past it would happen after using my repl long enough, but now it’s happening during a full test. any common pitfalls? i did look through the docs 😉
> Caused by: org.postgresql.util.PSQLException: FATAL: sorry, too many clients already
there should be some way to ask postgres how many connected clients it has, you should do that and see if you get an expected amount. for unix like operating systems there are commands to list open tcp connections, you should run those and see how many open sockets are connected to postgres, you should do a bisecting search by disabling half your test suite over and over to see if you can isolate a particular case/test/file etc
or you could just use a connection pool library and configure it to never hand out too many connections
do you know what the max client limit for your postgres install is and is hikari configured not to exceed that?
i was trying to figure out how to line those up, i’m using the pg docker image and hikari pool defaults
connection pools tend to create connections immediately and keep them alive, so if you create 10 pools your connections are all used up regardless of if you are using those pools or not