[#1700] gc: Take mode mutex in locks handlers
All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m15s
Pre-commit hooks / Pre-commit (push) Successful in 2m11s
Build / Build Components (push) Successful in 2m28s
Tests and linters / Lint (push) Successful in 3m21s
Tests and linters / Staticcheck (push) Successful in 3m38s
Tests and linters / Run gofumpt (push) Successful in 4m1s
OCI image / Build container images (push) Successful in 4m48s
Tests and linters / gopls check (push) Successful in 4m39s
Tests and linters / Tests (push) Successful in 5m5s
Tests and linters / Tests with -race (push) Successful in 6m32s

Change-Id: I4408eae3aed936f85427b6246dcf727bd6813a0d
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2025-04-01 12:50:21 +03:00
parent 27899598dc
commit f62d81e26a
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0

View file

@ -664,7 +664,10 @@ func (s *Shard) HandleExpiredTombstones(ctx context.Context, tss []meta.Tombston
// HandleExpiredLocks unlocks all objects which were locked by lockers.
// If successful, marks lockers themselves as garbage.
func (s *Shard) HandleExpiredLocks(ctx context.Context, epoch uint64, lockers []oid.Address) {
if s.GetMode().NoMetabase() {
s.m.RLock()
defer s.m.RUnlock()
if s.info.Mode.NoMetabase() {
return
}
@ -727,7 +730,10 @@ func (s *Shard) inhumeUnlockedIfExpired(ctx context.Context, epoch uint64, unloc
// HandleDeletedLocks unlocks all objects which were locked by lockers.
func (s *Shard) HandleDeletedLocks(ctx context.Context, lockers []oid.Address) {
if s.GetMode().NoMetabase() {
s.m.RLock()
defer s.m.RUnlock()
if s.info.Mode.NoMetabase() {
return
}