Skip to content

Commit b3476a4

Browse files
committed
timeout check in naive and TODO for adj latency stats
1 parent 977f9c9 commit b3476a4

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

eudoxia/scheduler/naive.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
def naive_pipeline_init(s):
1111
s.waiting_queue: List[Pipeline] = []
1212
s.multi_operator_containers = s.params["multi_operator_containers"]
13+
s.tick_number = 0
1314

1415
@register_scheduler(key="naive")
1516
def naive_pipeline(s, results: List[ExecutionResult],
@@ -27,6 +28,8 @@ def naive_pipeline(s, results: List[ExecutionResult],
2728
- List of new assignments to provide to Executor
2829
"""
2930

31+
s.tick_number += 1
32+
3033
# this scheduler doesn't make any new decisions unless there are
3134
# new pipelines arriving or containers exiting, so exit fast in
3235
# this case
@@ -54,8 +57,9 @@ def naive_pipeline(s, results: List[ExecutionResult],
5457
# find a pipeline with ops we can assign
5558
while s.waiting_queue:
5659
pipeline = s.waiting_queue.pop(0)
57-
has_failures = pipeline.runtime_status().state_counts[OperatorState.FAILED] > 0
58-
if pipeline.runtime_status().is_pipeline_successful() or has_failures:
60+
status = pipeline.runtime_status()
61+
has_failures = status.state_counts[OperatorState.FAILED] > 0
62+
if status.is_pipeline_successful() or has_failures or status.has_timed_out(s.tick_number):
5963
# we don't retry, so anything complete or with failures
6064
# will be permanently removed from the queue
6165
continue

eudoxia/simulator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class SimulatorStats(NamedTuple):
8888
pipelines_interactive: PipelineStats
8989
pipelines_batch: PipelineStats
9090

91+
# TODO: add penalty option to give latency for unfinished jobs
9192
def adjusted_latency(
9293
self,
9394
weights: Dict[Priority, float] = None,

0 commit comments

Comments
 (0)