Skip to content

Commit ad315a2

Browse files
committed
compute monitoring deltas on each poll
this means this monitoring code does not need to know if a cache-refresh happened or not subtleties: if someone modifies the poller dict elsewhere, this won't catch that becuase its sharing that mutable old state and so that mutator needs to send a monitoring notification themselves. that's how things are already i think: pollitem.scale_out and pollitem.scale_in already do that monitoring change this is probably broken - get some better testing. or perhaps redo how monitoring deltas happen entirely?
1 parent e4802d6 commit ad315a2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

parsl/jobs/job_status_poller.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ def __init__(self, executor: BlockProviderExecutor, monitoring: Optional["parsl.
2323

2424
def poll(self) -> None:
2525
now = time.time()
26+
previous_status = self.executor._poller_mutable_status
27+
2628
if now >= self._last_poll_time + self._executor.status_polling_interval:
27-
previous_status = self._executor._poller_mutable_status
2829
self._executor._poller_mutable_status = self._executor.status()
2930
self._last_poll_time = now
31+
32+
if previous_status != self.executor._poller_mutable_status:
33+
# short circuit the case where the two objects are identical so
34+
# delta_status must end up empty.
35+
3036
delta_status = {}
3137
for block_id in self._executor._poller_mutable_status:
3238
if block_id not in previous_status \

0 commit comments

Comments
 (0)