{"record":{"id":"3fbf8ef3048b4f12","repo":"quickwit-oss/quickwit","slug":"file-byte-range-cache-mutex-is-poisoned","errorCode":null,"errorMessage":"file byte range cache mutex is poisoned","messagePattern":"file 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":210,"sourceCode":"#[derive(Clone)]\npub struct FileByteRangeCache {\n    state: Arc<Mutex<FileByteRangeCacheState>>,\n    total_num_stored_bytes: Arc<AtomicU64>,\n}\n\nimpl FileByteRangeCache {\n    fn with_total_num_stored_bytes(total_num_stored_bytes: Arc<AtomicU64>) -> Self {\n        FileByteRangeCache {\n            state: Arc::new(Mutex::new(FileByteRangeCacheState::with_infinite_capacity())),\n            total_num_stored_bytes,\n        }\n    }\n\n    /// Returns the cached view of the slice if it is available.\n    pub fn get_slice(&self, byte_range: Range<usize>) -> Option<OwnedBytes> {\n        self.state\n            .lock()\n            .expect(\"file byte range cache mutex is poisoned\")\n            .get_slice(byte_range)\n    }\n\n    /// Stores the given slice in the cache.\n    pub fn put_slice(&self, byte_range: Range<usize>, bytes: OwnedBytes) {\n        let mut state = self\n            .state\n            .lock()\n            .expect(\"file byte range cache mutex is poisoned\");\n        let previous_num_bytes = state.num_bytes;\n        state.put_slice(byte_range, bytes);\n        let num_added_bytes = state.num_bytes - previous_num_bytes;\n        self.total_num_stored_bytes\n            .fetch_add(num_added_bytes, Ordering::Relaxed);\n    }\n}\n\n/// Cache for ranges of bytes in files.","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-storage/src/cache/byte_range_cache.rs#L192-L228","documentation":"`FileByteRangeCache::get_slice` locked the per-file cache state mutex and the lock returned a poison error, meaning another thread panicked while holding this mutex. The `.expect` then panics in turn. The original panic happened elsewhere; this message only tells you the cache state is unusable.","triggerScenarios":"Thrown at quickwit/quickwit-storage/src/cache/byte_range_cache.rs:210 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Look further up in the logs for the panic that poisoned the mutex — that is the real failure","Restart the searcher process/node to recover a clean cache state","Report the original panic to Quickwit maintainers if it looks like a bug"],"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"}