devinus/poolboy — pull request #58 by ppikula (2014-10-14 17:26:39+00:00)
Title: Fix setting monitors on calling processes

When process was in the waiting list it was monitored twice and only one monitor was canceled.

In my system I have a lot of long living processes that are using poolboy.
Under heavy load some of processes got queued in **#state.waiting** with pid and monitor reference. During checkin another erlang:monitor was set, so after couple of hours I started to receive long_schedule alarms. I found out using process_info that poolboy gen_server had ~12 millions monitors.

The fix uses monitor reference taken from the waiting list instead of creating a new one.