|
15 | 15 | from .job_scheduling_information import JobSchedulingInformation |
16 | 16 | from .slurm.slurm_client import SlurmClient |
17 | 17 | from .slurm.slurm_rest import ( |
| 18 | + CurrentEnum as JobStateEnum, |
18 | 19 | JobDescMsg, |
19 | 20 | JobInfo, |
20 | 21 | JobSubmitReq, |
21 | | - JobStateEnum, |
22 | 22 | StringArray, |
23 | 23 | Uint32NoValStruct, |
24 | 24 | Uint64NoValStruct, |
|
38 | 38 | ], |
39 | 39 | ) |
40 | 40 |
|
41 | | -# class NewJobStateEnum(Enum): |
42 | | -# CANCELLED = "CANCELLED" # |
43 | | -# LAUNCH_FAILED = "LAUNCH_FAILED" # |
44 | | -# UPDATE_DB = "UPDATE_DB" # |
45 | | -# RECONFIG_FAIL = "RECONFIG_FAIL" # |
46 | | -# POWER_UP_NODE = "POWER_UP_NODE" # |
47 | | - |
48 | 41 |
|
49 | 42 | class STATEGROUP(tuple[SLURMSTATE], Enum): # type: ignore |
50 | 43 | OUTOFTIME = (SLURMSTATE.TIMEOUT, SLURMSTATE.DEADLINE) |
@@ -151,7 +144,7 @@ def fetch_and_update_state( |
151 | 144 | job_id = job_info.job_id |
152 | 145 | if job_id is None or job_id < 0: |
153 | 146 | raise ValueError(f"Job info has invalid job id: {job_info}") |
154 | | - state = job_info.job_state.root |
| 147 | + state = job_info.job_state |
155 | 148 | slurm_state = SLURMSTATE[state[0].value] if state else None |
156 | 149 |
|
157 | 150 | start_time = ( |
@@ -532,13 +525,14 @@ def handle_timeouts( |
532 | 525 | if deadline is not None |
533 | 526 | ] |
534 | 527 | ) |
| 528 | + logging.debug("Next deadline: %s", next_deadline) |
535 | 529 | check_time = min( |
536 | 530 | ((next_deadline - datetime.now()) / 2), timedelta(minutes=1) |
537 | 531 | ) |
538 | 532 |
|
539 | 533 | if not_started: |
540 | 534 | not_started = handle_not_started(not_started, check_time=check_time) |
541 | | - logging.info("Not started: %i", len(not_started)) |
| 535 | + logging.info("Not started: %i (%s)", len(not_started), check_time) |
542 | 536 |
|
543 | 537 | for jsi in wait_for_ended( |
544 | 538 | [v for k, v in running_jobs.items() if k not in not_started], |
|
0 commit comments