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 additional race condition that can cause P2P restart to deadlock #8094

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4804,7 +4804,7 @@ def stimulus_task_finished(self, key, worker, stimulus_id, run_id, **kwargs):

ws: WorkerState = self.workers[worker]
ts: TaskState = self.tasks.get(key)
if ts is None or ts.state in ("released", "queued"):
if ts is None or ts.state in ("released", "queued", "no-worker"):
logger.debug(
"Received already computed task, worker: %s, state: %s"
", key: %s, who_has: %s",
Expand Down
10 changes: 3 additions & 7 deletions distributed/shuffle/tests/test_shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,15 @@ async def test_restarting_does_not_deadlock(c, s):
"shuffle-transfer", b.worker_address, 1, s
)
a.status = Status.paused
while len(s.running) > 1:
await asyncio.sleep(0.01)
await async_poll_for(lambda: len(s.running) == 1, timeout=5)
b.close_gracefully()
await b.process.process.kill()

while s.running:
await asyncio.sleep(0.01)
await async_poll_for(lambda: not s.running, timeout=5)

a.status = Status.running

while not s.running:
await asyncio.sleep(0.01)
pass
await async_poll_for(lambda: s.running, timeout=5)
Comment on lines +451 to +459
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are merely for easier debugging.

await fut


Expand Down