Skip to content

Commit

Permalink
storagenode/retain: clarify (Service).Queue behavior
Browse files Browse the repository at this point in the history
Change-Id: I44cb9d9c26f7a3f83ed680b193e49b7a462f7935
  • Loading branch information
elek authored and Storj Robot committed Mar 8, 2024
1 parent e7f86e8 commit 031c5a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion storagenode/piecestore/endpoint.go
Expand Up @@ -979,7 +979,7 @@ func (endpoint *Endpoint) Retain(ctx context.Context, retainReq *pb.RetainReques
if queued {
endpoint.log.Info("Retain job queued", zap.Stringer("Satellite ID", peer.ID))
} else {
endpoint.log.Info("Retain job not queued (job already exists)", zap.Stringer("Satellite ID", peer.ID))
endpoint.log.Info("Retain job not queued (queue is closed)", zap.Stringer("Satellite ID", peer.ID))
}

return &pb.RetainResponse{}, nil
Expand Down
3 changes: 1 addition & 2 deletions storagenode/retain/retain.go
Expand Up @@ -118,8 +118,7 @@ func NewService(log *zap.Logger, store *pieces.Store, config Config) *Service {
}

// Queue adds a retain request to the queue.
// It discards a request for a satellite that already has a queued request.
// true is returned if the request is queued and false is returned if it is discarded.
// true is returned if the request is added to the queue, false if queue is closed.
func (s *Service) Queue(req Request) bool {
s.cond.L.Lock()
defer s.cond.L.Unlock()
Expand Down

0 comments on commit 031c5a6

Please sign in to comment.