{"record":{"id":"e8168a74237b898e","repo":"quickwit-oss/quickwit","slug":"byte-range-cache-mutex-is-poisoned","errorCode":null,"errorMessage":"byte range cache mutex is poisoned","messagePattern":"byte range cache mutex is poisoned","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-storage/src/cache/byte_range_cache.rs","lineNumber":275,"sourceCode":"impl ByteRangeCache {\n    /// Creates a slice cache that never removes any entry.\n    pub fn with_infinite_capacity() -> Self {\n        let inner = Inner {\n            total_num_stored_bytes: Arc::new(AtomicU64::default()),\n            file_caches: Mutex::new(FxHashMap::default()),\n        };\n        ByteRangeCache {\n            inner_arc: Arc::new(inner),\n        }\n    }\n\n    /// Returns the shared byte-range cache for `path`.\n    pub fn get_file_cache(&self, path: &Path) -> FileByteRangeCache {\n        let mut file_caches = self\n            .inner_arc\n            .file_caches\n            .lock()\n            .expect(\"byte range cache mutex is poisoned\");\n        if let Some(file_cache) = file_caches.get(path) {\n            return file_cache.clone();\n        }\n        let file_cache = FileByteRangeCache::with_total_num_stored_bytes(\n            self.inner_arc.total_num_stored_bytes.clone(),\n        );\n        file_caches.insert(path.to_path_buf(), file_cache.clone());\n        file_cache\n    }\n\n    /// Overall amount of bytes stored in the cache.\n    pub fn get_num_bytes(&self) -> u64 {\n        self.inner_arc\n            .total_num_stored_bytes\n            .load(Ordering::Relaxed)\n    }\n}\n","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-storage/src/cache/byte_range_cache.rs#L257-L293","documentation":"`ByteRangeCache::get_file_cache` locked the map of per-file caches and the mutex was poisoned — some thread panicked earlier while holding it, and the `.expect` on the lock result now panics too. The root-cause panic is a separate earlier failure in code that mutates the file cache map.","triggerScenarios":"Thrown at quickwit/quickwit-storage/src/cache/byte_range_cache.rs:275 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Find the original panic that poisoned the mutex in earlier logs","Restart the process to rebuild the byte range cache","Report the underlying panic if it stems from Quickwit code"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}