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

erase from persistent_term without blocking registry #4545

Closed

Conversation

SteffenDE
Copy link
Contributor

Note: this is a draft. I talked to @josevalim and we're not 100% sure how to handle this yet. Another idea was to just not erase entries from persistent_term.

This was an interesting problem. It started with me updating the dependencies in phoenix_live_dashboard and noticing test failures related to our test of the Ecto Stats page. The stats page calls Ecto.Repo.all_running to get a list of repos.

The problem was that the test case still got an old repo as running, even though the previous test already stopped it (using start_supervised). It turns out that the :persistent_term.erase was slowing the registry GenServer down too much, therefore it wasn't processing the DOWN messages fast enough and not deleting the old repo entries from ets before the new test was already running.

This was an interesting problem. It started with me updating the
dependencies in phoenix_live_dashboard and noticing test failures related
to our test of the Ecto Stats page. The stats page calls `Ecto.Repo.all_running`
to get a list of repos. The problem was that the test case still got
an old repo as running, even though the previous test already stopped
it (using start_supervised). It turns out that the :persistent_term.erase
was slowing the registry GenServer down too much, therefore it wasn't
processing the DOWN messages fast enough and not deleting the old repo
entries from ets before the new test was already running.
@SteffenDE
Copy link
Contributor Author

@josevalim
Copy link
Member

I ended up reverting it. Thank you for spelunking!

@josevalim josevalim closed this Nov 9, 2024
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