LSylvester
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
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m aware of 2 such projects, are there others?
git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley:
Mutonex gamedesign was finish...
New
Do we have maintainer of absinthe-graphql/dataloader here? We have a PR that we’d like to merge to the library. Relatively small additive...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #hex










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
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.stopof 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.LSylvester
That’s what I’m doing now. So, I have a pool which has many workers. Each worker is a GenServer with a Connection in its state. If I kill the connection and put the worker back, then manage to check it out again soon after, the worker hasn’t yet had its
:DOWNhandler called, and so the next process to use it crashes.LSylvester
What would be really nice is if Poolboy checked for a particular function in the worker, such as an
is_ready()function, where the server could check if the Connection objects PID was alive and returntrueorfalse. That would solve the issue, I think.fishcakez
That isn’t quite the same as what I said. I said monitor the worker and wait for that go to
:DOWN.fishcakez
Would poolboy be making a call to the worker? If the worker is busy this blocks the pool waiting on a single worker. This could be prevented by having the worker do the checkin instead of the calling process. However then the worker needs to do the monitoring instead of poolboy, and the worker needs to know about poolboy, and suddenly everything is different. I have a library that follows a similar pattern: GitHub - fishcakez/sbroker: Sojourn-time based active queue management library · GitHub but by making some hard problems easier it also makes some easy problems harder. I would not recommend it unless it can solve a problem that a simpler solution can not.
darnahsan
I might. be facing the same issue in my application, did you get to a solution for this @LSylvester