Skip to content

Commit fb69a7a

Browse files
committedNov 9, 2024·
Do not clean up from persistent_term, closes #342
1 parent 9eaf214 commit fb69a7a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

‎lib/broadway/topology.ex

+8-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,14 @@ defmodule Broadway.Topology do
9191
ref = Process.monitor(supervisor_pid)
9292
Process.exit(supervisor_pid, reason_to_signal(reason))
9393

94-
receive do
95-
{:DOWN, ^ref, _, _, _} -> :persistent_term.erase({Broadway, name})
96-
end
94+
# We don't delete from persistent term on purpose. Since the process is
95+
# named, we can assume it does not start dynamically, so it will either
96+
# restart or the amount of memory it uses is negligibla to justify the
97+
# process purging done by persistent_term. If the repo is restarted and
98+
# stores the same metadata, then no purging happens either.
99+
# receive do
100+
# {:DOWN, ^ref, _, _, _} -> :persistent_term.erase({Broadway, name})
101+
# end
97102

98103
:ok
99104
end

0 commit comments

Comments
 (0)
Please sign in to comment.