File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,15 @@ def write_to_zarr(self,
8686 # compute size of the slab
8787 slab_size_bytes = np .prod (slice_chunks ) * np .dtype (self .dtype ).itemsize
8888
89- # get dask worker allocated memery size
90- dask_worker_memory_bytes = next (iter (client .scheduler_info ()["workers" ].values ()))["memory_limit" ]
89+ # get dask worker allocated memory size
90+ # Wait for at least one worker to be available
91+ try :
92+ client .wait_for_workers (n_workers = 1 , timeout = 30 ) # Wait up to 30 seconds for 1 worker
93+ workers_info = client .scheduler_info ()["workers" ]
94+ dask_worker_memory_bytes = next (iter (workers_info .values ()))["memory_limit" ]
95+
96+ except Exception as e :
97+ logger .warning (f"Failed to get worker memory info: { e } " )
9198
9299 logger .info (f"Slab size: { slab_size_bytes / 1e9 } GB" )
93100 logger .info (f"Dask memory limit: { dask_worker_memory_bytes / 1e9 } GB" )
You can’t perform that action at this time.
0 commit comments