Skip to content

GenServer Bottlenecks #116

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

mjquinlan2000
Copy link

There is a bottleneck in the way that ExAudit.CustomData stores pids in the ETS table. I was getting GenServer.call time out errors on my server. This PR ensures that the pid is written to ETS before the pid is stored in the GenServer. The GenServer is invoked with a cast instead of a call to make the request non-blocking. In handle_cast({:store ... the GenServer will first try to monitor the pid. Then it will check to see if the pid is still alive. If it is not, it will immediately remove it from the ets table. This prevents blocking the call in application code.

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.

1 participant