File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 11** Note** : Numbers like (\# 123) point to closed Pull Requests on the fractal-tasks-core repository.
22
3- # Unreleased
3+ # 1.4.3
44
5+ * Tasks:
6+ * Update apply_registration_to_image to handle race conditions better (\# 919).
57* Testing
68 * Add ` spherical-harmonics ` extra to scmultiplex, for testing manifest build (\# 899).
79 * Move manifest-creation CI to Python 3.11 (\# 915).
Original file line number Diff line number Diff line change @@ -205,23 +205,34 @@ def apply_registration_to_image(
205205 # Get the relevant metadata of the Zarr table & add it
206206 # See issue #516 for the need for this workaround
207207 max_retries = 20
208- sleep_time = 5
208+ sleep_time = 10
209209 current_round = 0
210210 while current_round < max_retries :
211211 try :
212212 old_table_group = zarr .open_group (
213213 table_dict [table ], mode = "r"
214214 )
215215 current_round = max_retries
216- except zarr .errors .GroupNotFoundError :
216+ curr_table = ad .read_zarr (table_dict [table ])
217+ break # Exit loop on success
218+ except (
219+ zarr .errors .GroupNotFoundError ,
220+ zarr .errors .PathNotFoundError ,
221+ ):
217222 logger .debug (
218223 f"Table { table } not found in attempt { current_round } . "
219224 f"Waiting { sleep_time } seconds before trying again."
220225 )
221226 current_round += 1
222227 time .sleep (sleep_time )
228+ else :
229+ # This runs only if the loop exits via exhaustion
230+ raise RuntimeError (
231+ f"Table { table } not found after { max_retries } attempts."
232+ "Check whether this table actually exists. If it does, "
233+ "this may be a race condition issue."
234+ )
223235 # Write the Zarr table
224- curr_table = ad .read_zarr (table_dict [table ])
225236 write_table (
226237 new_image_group ,
227238 table ,
You can’t perform that action at this time.
0 commit comments