Skip to content

Commit 23438eb

Browse files
authored
Fix duration bug for scattered tasks (#618)
1 parent f1a2b67 commit 23438eb

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Job Manager Change Log
22

3+
## v0.7.1 Release Notes
4+
5+
### Added individual shards and their execution events to the timing diagram.
6+
7+
## v0.7.0 Release Notes
8+
9+
### Further improved the performance of the Job dDetails page when pointed at Cromwell.
10+
11+
### Made the behavior of all log and execution directory icons/links consistent throughout the Job Details page.
12+
13+
### Added more useful UI behavior when user submits an invalid query on the Job List page.
14+
15+
### Surfaced additional error information from Cromwell metadata responses on the Job Details page.
16+
317
## v0.6.3 Release Notes
418

519
### Fixed bug where failure message(s) are not displayed if the job failed before Cromwell was able to run it (most likely due to a validation error).

servers/cromwell/jobs/controllers/jobs_controller.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,11 @@ def format_scattered_task(task_name, task_metadata):
231231
filtered_shards = []
232232
current_shard = ''
233233
min_start = _parse_datetime(task_metadata[0].get('start'))
234+
max_end = _parse_datetime(task_metadata[-1].get('end'))
234235

235236
# go through calls in reverse to grab the latest attempt if there are multiple
236237
for shard in task_metadata[::-1]:
237238
if current_shard != shard.get('shardIndex'):
238-
if min_start > _parse_datetime(shard.get('start')):
239-
min_start = _parse_datetime(shard.get('start'))
240239
filtered_shards.append(
241240
TaskShard(
242241
execution_status=task_statuses.cromwell_execution_to_api(
@@ -246,6 +245,13 @@ def format_scattered_task(task_name, task_metadata):
246245
shard_index=shard.get('shardIndex'),
247246
execution_events=_get_execution_events(
248247
shard.get('executionEvents'))))
248+
if min_start > _parse_datetime(shard.get('start')):
249+
min_start = _parse_datetime(shard.get('start'))
250+
if shard.get('executionStatus') not in ['Failed', 'Done']:
251+
max_end = None
252+
if max_end is not None and max_end < _parse_datetime(
253+
shard.get('end')):
254+
max_end = _parse_datetime(shard.get('end'))
249255
current_shard = shard.get('shardIndex')
250256

251257
sorted_shards = sorted(filtered_shards, key=lambda t: t.shard_index)
@@ -255,6 +261,7 @@ def format_scattered_task(task_name, task_metadata):
255261
execution_status=_get_scattered_task_status(sorted_shards),
256262
attempts=len(sorted_shards),
257263
start=min_start,
264+
end=max_end,
258265
call_root=remove_shard_path(task_metadata[-1].get('callRoot')),
259266
shards=sorted_shards,
260267
call_cached=False)

servers/cromwell/jobs/test/test_jobs_controller.py

+1
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ def _request_callback(request, context):
573573
'callCached': False,
574574
'attempts': attempts,
575575
'start': response_timestamp,
576+
'end': response_timestamp,
576577
'shards': [{
577578
'end': response_timestamp,
578579
'executionStatus': 'Failed',

0 commit comments

Comments
 (0)