Skip to content

Commit

Permalink
fix: Missing 'slots_occupied' in CeleryKubernetesExecutor and `Loca…
Browse files Browse the repository at this point in the history
…lKubernetesExecutor` (apache#41602)

Each time the base executor changes, often those need to be copied into
the old (soon to be deprecated) hybrid executors. This was missed for
the new slots_occupied property.
  • Loading branch information
o-nikolas authored Aug 20, 2024
1 parent 563bc49 commit 5cb582b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ def slots_available(self) -> int:
"""Number of new tasks this executor instance can accept."""
return self.celery_executor.slots_available

@property
def slots_occupied(self):
"""Number of tasks this executor instance is currently managing."""
return len(self.running) + len(self.queued_tasks)

def queue_command(
self,
task_instance: TaskInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def slots_available(self) -> int:
"""Number of new tasks this executor instance can accept."""
return self.local_executor.slots_available

@property
def slots_occupied(self):
"""Number of tasks this executor instance is currently managing."""
return len(self.running) + len(self.queued_tasks)

def queue_command(
self,
task_instance: TaskInstance,
Expand Down

0 comments on commit 5cb582b

Please sign in to comment.