Skip to content

Commit ff62019

Browse files
committed
executors get current time directly from time, not from job status poller
this is a behavioural change - but what's the behavioural change? if there are multiple executors, then cache refreshes might now happen on a slightly different cadence: the 2nd executor now time will be later (it will be the end time of the 1st executor polling process) which means it might now fire a bit earlier
1 parent fc74a91 commit ff62019

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

parsl/executors/status_handling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22
import logging
33
import threading
4+
import time
45
from itertools import compress
56
from abc import abstractmethod, abstractproperty
67
from concurrent.futures import Future
@@ -242,7 +243,8 @@ def workers_per_node(self) -> Union[int, float]:
242243
def _should_poll(self, now: float) -> bool:
243244
return now >= self._last_poll_time + self.status_polling_interval
244245

245-
def _refresh_poll_mutable_status_if_time(self, now):
246+
def _refresh_poll_mutable_status_if_time(self):
247+
now = time.time()
246248
if self._should_poll(now):
247249
self._poller_mutable_status = self.status()
248250
self._last_poll_time = now

parsl/jobs/job_status_poller.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import parsl
3-
import time
43
from typing import Dict, List, Sequence, Optional, Union
54

65
from parsl.jobs.states import JobStatus, JobState
@@ -21,10 +20,9 @@ def __init__(self, executor: BlockProviderExecutor, monitoring: Optional["parsl.
2120
self._monitoring = monitoring
2221

2322
def poll(self) -> None:
24-
now = time.time()
2523
previous_status = self.executor._poller_mutable_status
2624

27-
self._executor._refresh_poll_mutable_status_if_time(now)
25+
self._executor._refresh_poll_mutable_status_if_time()
2826

2927
if previous_status != self.executor._poller_mutable_status:
3028
# short circuit the case where the two objects are identical so

0 commit comments

Comments
 (0)