Skip to content

Commit 59f22fc

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 shouldn't change any behaviour (but I'm not sure how well tested that is?)
1 parent b7cd9a4 commit 59f22fc

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
@@ -40,10 +40,16 @@ def _should_poll(self, now: float) -> bool:
4040
return now >= self._last_poll_time + self._interval
4141

4242
def poll(self, now: float) -> None:
43+
previous_status = self.executor._poller_mutable_status
44+
4345
if self._should_poll(now):
44-
previous_status = self.executor._poller_mutable_status
4546
self.executor._poller_mutable_status = self._executor.status()
4647
self._last_poll_time = now
48+
49+
if previous_status != self.executor._poller_mutable_status:
50+
# short circuit the case where the two objects are identical so
51+
# delta_status must end up empty.
52+
4753
delta_status = {}
4854
for block_id in self.executor._poller_mutable_status:
4955
if block_id not in previous_status \

0 commit comments

Comments
 (0)