From 4890b32c9262163c5c56b4cc70f9dc51e1708f34 Mon Sep 17 00:00:00 2001 From: Gowthami B Date: Wed, 1 Oct 2025 12:56:45 +0000 Subject: [PATCH] add lock for cachetools --- pyiceberg/manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyiceberg/manifest.py b/pyiceberg/manifest.py index 470c99d602..eafb2b7c03 100644 --- a/pyiceberg/manifest.py +++ b/pyiceberg/manifest.py @@ -17,6 +17,7 @@ from __future__ import annotations import math +import threading from abc import ABC, abstractmethod from copy import copy from enum import Enum @@ -875,7 +876,7 @@ def __hash__(self) -> int: return hash(self.manifest_path) -@cached(cache=LRUCache(maxsize=128), key=lambda io, manifest_list: hashkey(manifest_list)) +@cached(cache=LRUCache(maxsize=128), key=lambda io, manifest_list: hashkey(manifest_list), lock=threading.RLock()) def _manifests(io: FileIO, manifest_list: str) -> Tuple[ManifestFile, ...]: """Read and cache manifests from the given manifest list, returning a tuple to prevent modification.""" file = io.new_input(manifest_list)