Repository navigation
Closed
Labels
flaky testIntermittent failures on CI.Intermittent failures on CI.
Description
Known tests to be affected
In production environment validation is disabled which will likely cause other errors and/or deadlocks.
Traceback (most recent call last):
File "/home/runner/work/distributed/distributed/distributed/worker.py", line 3067, in gather_dep
response = await get_data_from_worker(
File "/home/runner/work/distributed/distributed/distributed/worker.py", line 4353, in get_data_from_worker
return await retry_operation(_get_data, operation="get_data_from_worker")
File "/home/runner/work/distributed/distributed/distributed/utils_comm.py", line 385, in retry_operation
return await retry(
File "/home/runner/work/distributed/distributed/distributed/utils_comm.py", line 370, in retry
return await coro()
File "/home/runner/work/distributed/distributed/distributed/worker.py", line 4330, in _get_data
comm = await rpc.connect(worker)
File "/home/runner/work/distributed/distributed/distributed/core.py", line 1067, in connect
comm = await fut
File "/home/runner/work/distributed/distributed/distributed/comm/core.py", line 329, in connect
raise OSError(
OSError: Timed out during handshake while connecting to tcp://127.0.0.1:36081 after 30 s
distributed.worker - ERROR -
Traceback (most recent call last):
File "/home/runner/work/distributed/distributed/distributed/worker.py", line 3986, in validate_task
self.validate_task_fetch(ts)
File "/home/runner/work/distributed/distributed/distributed/worker.py", line 3928, in validate_task_fetch
assert ts.who_has
Task story
(
"inc-aa226ae3a9f799819e1e685fba467442",
"compute-task",
"compute-task-1643835890.882272",
1643835890.8875856,
),
(
"inc-aa226ae3a9f799819e1e685fba467442",
"released",
"waiting",
"waiting",
{"inc-aa226ae3a9f799819e1e685fba467442": "ready"},
"compute-task-1643835890.882272",
1643835890.887607,
),
(
"inc-aa226ae3a9f799819e1e685fba467442",
"waiting",
"ready",
"ready",
{},
"compute-task-1643835890.882272",
1643835890.8876154,
),
(
"inc-aa226ae3a9f799819e1e685fba467442",
"ensure-task-exists",
"ready",
"compute-task-1643835890.8866765",
1643835890.8877435,
),
(
"inc-aa226ae3a9f799819e1e685fba467442",
"release-key",
"compute-task-1643835890.8866765",
1643835890.8879642,
),
(
"inc-aa226ae3a9f799819e1e685fba467442",
"ready",
"released",
"released",
{},
"compute-task-1643835890.8866765",
1643835890.8879726,
),
(
"inc-aa226ae3a9f799819e1e685fba467442",
"released",
"fetch",
"fetch",
{},
"compute-task-1643835890.8866765",
1643835890.8879821,
),
(
"inc-aa226ae3a9f799819e1e685fba467442",
"ready",
"fetch",
"fetch",
{},
"compute-task-1643835890.8866765",
1643835890.8879848,
),
Full story
AssertionError: Invalid TaskState encountered for <TaskState 'inc-aa226ae3a9f799819e1e685fba467442' fetch>.
Story:
[('inc-aa226ae3a9f799819e1e685fba467442', 'ensure-task-exists', 'released', 'compute-task-1643835890.875481', 1643835890.8762364), ('inc-aa226ae3a9f799819e1e685fba467442', 'released', 'fetch', 'fetch', {}, 'compute-task-1643835890.875481', 1643835890.876392), ('gather-dependencies', 'tcp://127.0.0.1:36081', {'inc-0c3f7739638b70e403ab21f80b09970b', 'inc-74fa2a3ce29de41facb1b01e75154df2', 'inc-bc330a1ea35cf0e28ef6270b770981cb', 'inc-aa226ae3a9f799819e1e685fba467442', 'inc-1bc6cda651ec56203f196053394876a1'}, 'ensure-communicating-1643835890.8765168', 1643835890.8765872), ('inc-aa226ae3a9f799819e1e685fba467442', 'fetch', 'flight', 'flight', {}, 'ensure-communicating-1643835890.8765168', 1643835890.876613), ('request-dep', 'tcp://127.0.0.1:36081', {'inc-0c3f7739638b70e403ab21f80b09970b', 'inc-74fa2a3ce29de41facb1b01e75154df2', 'inc-bc330a1ea35cf0e28ef6270b770981cb', 'inc-aa226ae3a9f799819e1e685fba467442', 'inc-1bc6cda651ec56203f196053394876a1'}, 'ensure-communicating-1643835890.8765168', 1643835890.876833), ('receive-dep-failed', 'tcp://127.0.0.1:36081', {'inc-0c3f7739638b70e403ab21f80b09970b', 'inc-74fa2a3ce29de41facb1b01e75154df2', 'inc-bc330a1ea35cf0e28ef6270b770981cb', 'inc-aa226ae3a9f799819e1e685fba467442', 'inc-1bc6cda651ec56203f196053394876a1'}, 'ensure-communicating-1643835890.8765168', 1643835890.8813467), ('inc-aa226ae3a9f799819e1e685fba467442', 'missing-dep', 'ensure-communicating-1643835890.8765168', 1643835890.8813949), ('inc-aa226ae3a9f799819e1e685fba467442', 'flight', 'missing', 'missing', {}, 'ensure-communicating-1643835890.8765168', 1643835890.881428), ('inc-aa226ae3a9f799819e1e685fba467442', 'release-key', 'processing-released-1643835890.880434', 1643835890.8822312), ('inc-aa226ae3a9f799819e1e685fba467442', 'missing', 'released', 'released', {'inc-aa226ae3a9f799819e1e685fba467442': 'forgotten'}, 'processing-released-1643835890.880434', 1643835890.8822412), ('inc-aa226ae3a9f799819e1e685fba467442', 'released', 'forgotten', 'forgotten', {}, 'processing-released-1643835890.880434', 1643835890.882249), ('inc-aa226ae3a9f799819e1e685fba467442', 'compute-task', 'compute-task-1643835890.880547', 1643835890.8824306), ('inc-aa226ae3a9f799819e1e685fba467442', 'released', 'waiting', 'waiting', {'inc-aa226ae3a9f799819e1e685fba467442': 'ready'}, 'compute-task-1643835890.880547', 1643835890.882451), ('inc-aa226ae3a9f799819e1e685fba467442', 'waiting', 'ready', 'ready', {}, 'compute-task-1643835890.880547', 1643835890.8824592), ('inc-aa226ae3a9f799819e1e685fba467442', 'ready', 'executing', 'executing', {}, 'ensure-computing-1643835890.8831396', 1643835890.8831706), ('inc-aa226ae3a9f799819e1e685fba467442', 'put-in-memory', 'ensure-computing-1643835890.8831396', 1643835890.8835356), ('inc-aa226ae3a9f799819e1e685fba467442', 'executing', 'memory', 'memory', {}, 'ensure-computing-1643835890.8831396', 1643835890.883553), ('free-keys', ('inc-aa226ae3a9f799819e1e685fba467442',), 'processing-released-1643835890.8822534', 1643835890.8875349), ('inc-aa226ae3a9f799819e1e685fba467442', 'release-key', 'processing-released-1643835890.8822534', 1643835890.8875427), ('inc-aa226ae3a9f799819e1e685fba467442', 'memory', 'released', 'released', {'inc-aa226ae3a9f799819e1e685fba467442': 'forgotten'}, 'processing-released-1643835890.8822534', 1643835890.8875651), ('inc-aa226ae3a9f799819e1e685fba467442', 'released', 'forgotten', 'forgotten', {}, 'processing-released-1643835890.8822534', 1643835890.8875735), ('inc-aa226ae3a9f799819e1e685fba467442', 'compute-task', 'compute-task-1643835890.882272', 1643835890.8875856), ('inc-aa226ae3a9f799819e1e685fba467442', 'released', 'waiting', 'waiting', {'inc-aa226ae3a9f799819e1e685fba467442': 'ready'}, 'compute-task-1643835890.882272', 1643835890.887607), ('inc-aa226ae3a9f799819e1e685fba467442', 'waiting', 'ready', 'ready', {}, 'compute-task-1643835890.882272', 1643835890.8876154), ('inc-aa226ae3a9f799819e1e685fba467442', 'ensure-task-exists', 'ready', 'compute-task-1643835890.8866765', 1643835890.8877435), ('inc-aa226ae3a9f799819e1e685fba467442', 'release-key', 'compute-task-1643835890.8866765', 1643835890.8879642), ('inc-aa226ae3a9f799819e1e685fba467442', 'ready', 'released', 'released', {}, 'compute-task-1643835890.8866765', 1643835890.8879726), ('inc-aa226ae3a9f799819e1e685fba467442', 'released', 'fetch', 'fetch', {}, 'compute-task-1643835890.8866765', 1643835890.8879821), ('inc-aa226ae3a9f799819e1e685fba467442', 'ready', 'fetch', 'fetch', {}, 'compute-task-1643835890.8866765', 1643835890.8879848)]
Metadata
Metadata
Assignees
Labels
flaky testIntermittent failures on CI.Intermittent failures on CI.
Activity
fjetter commentedon Feb 3, 2022
Looks like this is a regression introduced by #5653
fjetter commentedon Feb 3, 2022
This is a weird one, again.
The assertion is raised during a
handle_task_computefor a taskAwho has a dependencyB. The scheduler claims that the worker already has the data for this key but this is not true. In fact, the worker merely queued it up andBis in statereadyat the time.I encountered such a condition already but couldn't make sense of it at the time. This led to us filtering out the "self.address" in
distributed/distributed/worker.py
Lines 3195 to 3202 in 30ffa9c
since otherwise gather_dep would run in an endless loop trying to fetch data from itself (yes, that's possible 🤦 ) #4784
Will likely need to dig a bit deeper in what the scheduler thinks its doing
[-]test_submit_after_failed_worker_sync failing[/-][+]who_has not set for task in state fetch[/+]fjetter commentedon Feb 9, 2022
There are a few things happening.
While the worker B is trying to fetch data from worker A, worker A is killed such that the tasks are reassigned to worker B, i.e. this is a
fetch->waiting(->ready) transition which moves over the intermediatecancelled->resumedsince the worker is waiting for the connection to fail.However, the failed connection pings the scheduler with a
missing-depsignal which will transition the (now processing on B) task to released. This will cause a bit of a vicious cycle ofrelease->compute->release->computewhich is not great but not the reason for this error.The assertionerror/deadlock appears iff the compute->release cycles overlap with a task-finished signal of a previous compute due to network delay. This will cause the dependent to be scheduled on workerB already even though workerB is still working off the initial task. Trying to work on the dependent will trigger its dependency to be transitioned to fetch but since the worker itself is the one "supposed to have it", it will appear empty.
This stuff is difficult to write down, below a timeline of events with a few annotations
Annotated timeline of events
Apart from this I noticed two more things behaving weirdly.
T1 (memory) -> T2 (processing). IfT1is released (e.g. lost worker) this will cause T1 to be rescheduled before T2 is released. This can cause weird situations on worker side, assuming we rely on ordering (so far I assumed ordering is reliable)See below, this ordering depends on the insertion order to the recommendations dict
Server.handle_streamclose the comm? #5483)crusaderky commentedon Feb 11, 2022
Closed by #5786