mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-25 09:00:37 +00:00
Fix race condition in image layer (#1440)
* Fix race condition in image layer refer #1439 * Add explicit drop(inner) in layer load method * Add explicit drop(inner) in layer load method
This commit is contained in:
committed by
GitHub
parent
649f324fe3
commit
1aa8fe43cf
@@ -267,7 +267,7 @@ impl ImageLayer {
|
||||
// a write lock. (Or rather, release and re-lock in write mode.)
|
||||
drop(inner);
|
||||
let mut inner = self.inner.write().unwrap();
|
||||
if inner.book.is_none() {
|
||||
if !inner.loaded {
|
||||
self.load_inner(&mut inner)?;
|
||||
} else {
|
||||
// Another thread loaded it while we were not holding the lock.
|
||||
|
||||
Reference in New Issue
Block a user