From 0d95a9c1ff14773b722009a6c6fd6ad66c7ce395 Mon Sep 17 00:00:00 2001 From: Shuwen Wang <47200617+alphabetc1@users.noreply.github.com> Date: Mon, 14 Sep 2026 13:12:28 +0800 Subject: [PATCH] [HiCache] Keep the file backend temp file name within NAME_MAX (#38925) --- python/sglang/srt/mem_cache/hicache_storage.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/sglang/srt/mem_cache/hicache_storage.py b/python/sglang/srt/mem_cache/hicache_storage.py index b573e69f1..f469daac8 100644 --- a/python/sglang/srt/mem_cache/hicache_storage.py +++ b/python/sglang/srt/mem_cache/hicache_storage.py @@ -533,10 +533,7 @@ class HiCacheFile(HiCacheStorage): return False reserved = True - tmp_path = ( - f"{tensor_path}.tmp." - f"{os.getpid()}.{threading.get_ident()}.{uuid.uuid4().hex}" - ) + tmp_path = os.path.join(self.file_path, f".{uuid.uuid4().hex}.tmp") value.contiguous().view(dtype=torch.uint8).numpy().tofile(tmp_path) os.replace(tmp_path, tensor_path) self._evictor.commit(suffixed)