Skip to content

Commit

Permalink
Remove stimulus_id from long running messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Apr 11, 2022
1 parent 1e1d969 commit d5a013a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
7 changes: 1 addition & 6 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5713,18 +5713,13 @@ def release_worker_data(self, key, worker, stimulus_id):
if recommendations:
self.transitions(recommendations, stimulus_id)

def handle_long_running(
self, key=None, worker=None, compute_duration=None, stimulus_id=None
):
def handle_long_running(self, key=None, worker=None, compute_duration=None):
"""A task has seceded from the thread pool
We stop the task from being stolen in the future, and change task
duration accounting as if the task has stopped.
"""
parent: SchedulerState = cast(SchedulerState, self)
# TODO(sjperkins): This stimulus isn't passed anywhere, so
# could probably be removed from the signature before the PR is merged
assert stimulus_id
if key not in parent._tasks:
logger.debug("Skipping long_running since key %s was already released", key)
return
Expand Down
8 changes: 1 addition & 7 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2451,13 +2451,7 @@ def transition_executing_long_running(
return merge_recs_instructions(
(
{},
[
LongRunningMsg(
key=ts.key,
compute_duration=compute_duration,
stimulus_id=stimulus_id,
)
],
[LongRunningMsg(key=ts.key, compute_duration=compute_duration)],
),
self._ensure_computing(),
)
Expand Down
3 changes: 1 addition & 2 deletions distributed/worker_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,9 @@ class RescheduleMsg(SendMessageToScheduler):
class LongRunningMsg(SendMessageToScheduler):
op = "long-running"

__slots__ = ("key", "compute_duration", "stimulus_id")
__slots__ = ("key", "compute_duration")
key: str
compute_duration: float
stimulus_id: str


@dataclass
Expand Down

0 comments on commit d5a013a

Please sign in to comment.