From 702e4d5964b9877c1cbc8f0e5f732d4889d217d7 Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Wed, 30 Sep 2020 10:44:29 +0100 Subject: [PATCH] Return on failure to acquire a semaphore --- CHANGELOG.md | 3 +++ services/beaconcommitteesubscriber/standard/service.go | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c4cd87..c20b6cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +Development + - do not continue if attempt to acquire a semaphore fails + 0.6.1 - update documentation for account managers, explaining the difference between Dirk and wallet - add submitter configuration to documentation diff --git a/services/beaconcommitteesubscriber/standard/service.go b/services/beaconcommitteesubscriber/standard/service.go index 1ed36f6..571c78e 100644 --- a/services/beaconcommitteesubscriber/standard/service.go +++ b/services/beaconcommitteesubscriber/standard/service.go @@ -181,6 +181,7 @@ func (s *Service) calculateSubscriptionInfo(ctx context.Context, defer wg.Done() if err := sem.Acquire(ctx, 1); err != nil { log.Error().Err(err).Msg("Failed to obtain semaphore") + return } defer sem.Release(1) subscriptionInfoMutex.RLock()