test(providers): notify after releasing the lock (#5154)

Following the recommended pattern with the expectation of
reducing potential deadlocks in future changes.
This commit is contained in:
Julio López
2026-02-10 22:49:46 -08:00
committed by GitHub
parent 8ec295eddd
commit a9ad321f60

View File

@@ -48,12 +48,14 @@ func (vf *verifySyncBeforeCloseFile) Sync() error {
}
func (vf *verifySyncBeforeCloseFile) Close() error {
vf.mu.Lock()
defer vf.mu.Unlock()
dirty, err := func() (bool, error) {
vf.mu.Lock()
defer vf.mu.Unlock()
err := vf.osWriteFile.Close()
return vf.dirty, vf.osWriteFile.Close()
}()
if vf.dirty {
if dirty {
vf.notifyDirtyClose()
}