[#2057] blobstor: Block operations on a mode change

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-11-15 15:33:48 +03:00 committed by fyrchik
parent 1779664644
commit fa231b8c56
7 changed files with 21 additions and 0 deletions

View file

@ -10,6 +10,9 @@ import (
// Returns any error encountered that did not allow
// to completely check object existence.
func (b *BlobStor) Exists(prm common.ExistsPrm) (common.ExistsRes, error) {
b.modeMtx.RLock()
defer b.modeMtx.RUnlock()
// If there was an error during existence check below,
// it will be returned unless object was found in blobovnicza.
// Otherwise, it is logged and the latest error is returned.