There are a couple questions you should ask yourself: 1. Why are you trapping exists?
2. What happens when the worker dies? 3. What happens when the connection dies? 4. I believe hackney already ships with its own pools, can't you use them? In any case, it seems your code does not *link* the worker process with the connection process. This means that, if the worker is suddenly killed, the connection will leak. However, given you are trapping exists, I believe it can only happen if the :kill message is used to kill the worker process (which is something supervisors may use). If you really need your own pool, the simplest solution would be to remove the trapping of exits and link the two processes. This way you answer question by not trapping and you guarantee the worker will die when the connection dies and vice-versa. *José Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Mon, Aug 8, 2016 at 6:59 PM, Eric Goodwin <[email protected]> wrote: > I am using poolboy to manage a pool of search workers. > Each search worker is a genserver and has a hackney connection in it's > state. For some reason, we're getting a leak where hackney is keeping > connections open. The search processes only have the one connection in the > state, but can have quite a few connections in it's process library. > > Here are main parts of the Search module. > https://gist.github.com/ericgoodwin/0d7dcd9d0f43c75337dc43a5df0423b2 > > Any ideas why we'd be getting a leak with connections staying open in the > process library? > Thanks! > > > > > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/elixir-lang-talk/7436695e-b28b-4ba2-9a9d- > efaa47d3dde6%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-talk/7436695e-b28b-4ba2-9a9d-efaa47d3dde6%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/CAGnRm4%2Bt665kpVxSA_YroZf83tKSNwuiEg4pp7uMxL%2BZxiB1tA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
