taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.15k stars 130 forks source link

Does the connection close? #202

Closed rafacustodio closed 6 years ago

rafacustodio commented 6 years ago

By this example
(defmacro wcar* [& body] `(car/wcar server1-conn ~@body))

I would like to know if the connection close everytime? There is a state for the connection?

kenan-rhoton commented 6 years ago

I'm running into a problem I suspect is related to this: I'm running a project with clojure-expectations for the unit tests, and it seems like some process related to carmine never closes, which does not allow unit tests to finish (despite there being no errors and everything working perfectly).

I've sniffed around and it seems that this is do to some thread pool not being closed properly, but I wouldn't know how to forcefully close the connection after the tests are done...

ptaoussanis commented 6 years ago

Hi Rafael, Carmine uses a connection pool by default. Not sure what you mean by "state"? In any case, you can skip or override the default connection pool through options to wcar.

E.g.: (wcar {:pool :none :spec {:host \"127.0.0.1\" :port 6379}} ...)

Hope that helps?

ptaoussanis commented 6 years ago

@kenan-rhoto Is this still an issue with 2.18.0? If so, could you please create a new issue with a reproducible example? Thanks!

kenan-rhoton commented 6 years ago

We moved back to clojure.test as a workaround, as that forces a termination upon finishing the tests, so we haven't experienced this anymore. I can try to quickly reproduce it to see if it works, if no one else wants to.