Skip to content

Commit 3c32b5d

Browse files
committed
dont lock during io
1 parent a5b7544 commit 3c32b5d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pyiceberg/manifest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,11 +919,14 @@ def _manifests(io: FileIO, manifest_list: str) -> tuple[ManifestFile, ...]:
919919
Returns:
920920
A tuple of ManifestFile objects (tuple to prevent modification).
921921
"""
922+
# Read manifest list outside the lock to avoid blocking other threads during I/O
922923
file = io.new_input(manifest_list)
923-
result = []
924+
manifest_files = list(read_manifest_list(file))
924925

926+
# Only hold the lock while updating the cache
927+
result = []
925928
with _manifest_cache_lock:
926-
for manifest_file in read_manifest_list(file):
929+
for manifest_file in manifest_files:
927930
manifest_path = manifest_file.manifest_path
928931
if manifest_path in _manifest_cache:
929932
# Reuse the cached ManifestFile object

0 commit comments

Comments
 (0)