Skip to content

Commit

Permalink
Different stimulus_id's success/failure in Worker.execute
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Mar 31, 2022
1 parent 6d6a0ee commit 7bf0117
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3507,7 +3507,8 @@ async def execute(self, key: str, *, stimulus_id: str) -> None:
assert ts, self.story(key)
ts.done = True
result["key"] = ts.key
result["stimulus_id"] = stimulus_id = f"{result['op']}-{time()}"
result["stimulus_id"] = new_stimulus_id = f"{result['op']}-{time()}"
del stimulus_id
value = result.pop("result", None)
ts.startstops.append(
{"action": "compute", "start": result["start"], "stop": result["stop"]}
Expand Down Expand Up @@ -3544,7 +3545,7 @@ async def execute(self, key: str, *, stimulus_id: str) -> None:
result["traceback_text"],
)

self.transitions(recommendations, stimulus_id=stimulus_id)
self.transitions(recommendations, stimulus_id=new_stimulus_id)

logger.debug("Send compute response to scheduler: %s, %s", ts.key, result)

Expand All @@ -3563,7 +3564,7 @@ async def execute(self, key: str, *, stimulus_id: str) -> None:
ts,
"error",
**emsg,
stimulus_id=stimulus_id,
stimulus_id=f"execute-erred-{time}",
)
finally:
self.ensure_computing()
Expand Down

0 comments on commit 7bf0117

Please sign in to comment.