LSylvester
RMQ pool issues - Poolboy dishes out dead connections
Hey guys,
I’m currently using Poolboy to manage a pool of AMQP connections. In my unit tests, I have some that kill connections to test the service comes back. However, Poolboy dishes out dead connections because the kill in the actual connection module takes a while to bubble up to the GenServers terminate function. I’m following the advice given for AMQP, but it just isn’t working out.
Is there a decent solution to this?
Thanks,
Lee
Most Liked
fishcakez
I can’t quite understand your setup but you can prevent poolboy giving the worker to the next process by monitoring the worker and waiting for the :DOWN. GenServer.stop of the worker will provide this guarantee. This works because poolboy is link’ed to the worker processes, and exit signals are sent before monitor signals. Therefore poolboy is guaranteed to have the exit signal in it is message queue before process receives the :DOWN. This means poolboy will handle the exit signal first and replace the worker.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








