Skip to content

Commit 70517fb

Browse files
committed
move status table updates for various tables together in scale out
TODO: this reveals a possible bug here that FAILED entries in simulated status are not immedaitely sent, but instead only get sent at the next poller update? unless submitted entries which are sent immediately? that should be an easy fix after this PR, though...
1 parent 20890ac commit 70517fb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

parsl/executors/status_handling.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,23 +194,27 @@ def scale_out_facade(self, n: int) -> List[str]:
194194
if not self.provider:
195195
raise ScalingFailed(self, "No execution provider available")
196196
block_ids = []
197+
monitoring_status_changes = {}
197198
logger.info(f"Scaling out by {n} blocks")
198199
for _ in range(n):
199200
block_id = str(self._block_id_counter.get_id())
200201
logger.info(f"Allocated block ID {block_id}")
201202
try:
202203
job_id = self._launch_block(block_id)
204+
205+
pending_status = JobStatus(JobState.PENDING)
206+
203207
self.blocks_to_job_id[block_id] = job_id
204208
self.job_ids_to_block[job_id] = block_id
209+
self._status[block_id] = pending_status
210+
211+
monitoring_status_changes[block_id] = pending_status
205212
block_ids.append(block_id)
213+
206214
except Exception as ex:
207215
self._simulated_status[block_id] = JobStatus(JobState.FAILED, "Failed to start block {}: {}".format(block_id, ex))
208216

209-
new_status = {}
210-
for block_id in block_ids:
211-
new_status[block_id] = JobStatus(JobState.PENDING)
212-
self.send_monitoring_info(new_status)
213-
self._status.update(new_status)
217+
self.send_monitoring_info(monitoring_status_changes)
214218
return block_ids
215219

216220
def scale_in(self, blocks: int) -> List[str]:

0 commit comments

Comments
 (0)