Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue when port is left dangling and catch poolboy timeout errors #172

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

criticalbh
Copy link
Contributor

image

When we open connection to Faktory, we observe some events but we never take care of port in terms of closing it.

When we receive one of following signals : :closed, :enotconn, :econnrefused we just ignore current socket and open a new one, which leads to port leak.
In this PR we are explicitly closing socket, and after observation :erlang.ports it shows that number of ports are not rising any more, everything stays in normal boundaries as it should be.

Also, we have handle_push_result({:error, :timeout}, job) but we are not catching timeout properly, because poolboy checkout raises an exception. In this PR we are catching exception and returning {:error, :timeout} which should be picked up by handle_push_result.

@Ch4s3 Ch4s3 merged commit b19485d into opt-elixir:master Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants