You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
azure-ai-ml: upload_directory silently swallows upload errors when show_progress=False #48269
azure.ai.ml._utils._asset_utils.upload_directory silently swallows worker upload failures when show_progress=False, so a directory upload can fail without raising, leaving a partial/incomplete upload in remote storage while callers proceed as if it succeeded.
Files are uploaded via a ThreadPoolExecutor. Exceptions raised inside a worker (upload_file) are captured on the Future and only re-raised when future.result() is called. That call currently lives only inside the if show_progress: branch:
withThreadPoolExecutor(max_workers=num_cores) asex:
futures_dict= { ex.submit(upload_file, ...): (src, dest) for ... }
ifshow_progress:
withtqdm(...) aspbar:
forfutureinas_completed(futures_dict):
future.result() # only reached when show_progress=Truepbar.update(...)
# when show_progress=False, .result() is never called -> exceptions swallowed
When show_progress=False, no one calls future.result(). The executor's shutdown(wait=True) waits for the threads to finish, but the stored exceptions are never observed, so upload_directory returns normally as if the upload succeeded.
Expected behavior
Upload errors should propagate regardless of the show_progress value.
Actual behavior
With show_progress=False, upload errors are silently ignored and the function returns None (apparent success).
Fix
Observe all futures (call future.result()) even when progress is disabled. Fixed in PR #48242.
Activity