From 3bf6e6dde60f15f4f90caf44eda429e8f6269cc1 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Wed, 10 Jul 2024 11:27:40 +0300 Subject: [PATCH] [#1238] engine: Add non-blocking send in the shard's notification channel Signed-off-by: Anton Nikiforov --- internal/logs/logs.go | 1 + pkg/local_object_storage/engine/shards.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/internal/logs/logs.go b/internal/logs/logs.go index ae8834517..5a195f688 100644 --- a/internal/logs/logs.go +++ b/internal/logs/logs.go @@ -252,6 +252,7 @@ const ( ShardCantInitializeMetabaseMoveToADegradedreadonlyMode = "can't initialize metabase, move to a degraded-read-only mode" ShardStopEventListenerByClosedEventChannel = "stop event listener by closed `event` channel" ShardStopEventListenerByClosedStopChannel = "stop event listener by closed `stop` channel" + ShardEventProcessingInProgress = "event processing is in progress, skip the received" ShardStopEventListenerByContext = "stop event listener by context" ShardCouldNotSubmitGCJobToWorkerPool = "could not submit GC job to worker pool" ShardGCIsStopped = "GC is stopped" diff --git a/pkg/local_object_storage/engine/shards.go b/pkg/local_object_storage/engine/shards.go index 54d3e7d65..56d4fcd4a 100644 --- a/pkg/local_object_storage/engine/shards.go +++ b/pkg/local_object_storage/engine/shards.go @@ -340,6 +340,9 @@ func (e *StorageEngine) HandleNewEpoch(ctx context.Context, epoch uint64) { case <-ctx.Done(): return case sh.NotificationChannel() <- ev: + default: + e.log.Debug(logs.ShardEventProcessingInProgress, + zap.Uint64("epoch", epoch), zap.Stringer("shard", sh.ID())) } } }