Skip to content

Commit

Permalink
tentative fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed May 9, 2022
1 parent a4f730c commit 6bede03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distributed/worker_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def memory_monitor(self, nanny: Nanny) -> None:
except (ProcessLookupError, psutil.NoSuchProcess, psutil.AccessDenied):
return # pragma: nocover

if proc.pid == self._last_terminated_pid:
if process.pid in (self._last_terminated_pid, None):
# We already sent SIGTERM to the worker, but its handler is still running
# since the previous iteration of the memory_monitor - for example, it
# may be taking a long time deleting all the spilled data from disk.
Expand All @@ -357,7 +357,7 @@ def memory_monitor(self, nanny: Nanny) -> None:
f"{self.memory_terminate_fraction * 100:.0f}% memory budget. "
"Restarting...",
)
self._last_terminated_pid = proc.pid
self._last_terminated_pid = process.pid
process.terminate()


Expand Down

0 comments on commit 6bede03

Please sign in to comment.