Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions server/jetstream_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4608,7 +4608,9 @@ func (s *Server) jsConsumerCreateRequest(sub *subscription, c *client, a *Accoun
if o := stream.lookupConsumer(consumerName); o != nil {
// If the consumer already exists then don't allow updating the PauseUntil, just set
// it back to whatever the current configured value is.
o.mu.RLock()
req.Config.PauseUntil = o.cfg.PauseUntil
o.mu.RUnlock()
}

// Initialize/update asset version metadata.
Expand All @@ -4629,9 +4631,11 @@ func (s *Server) jsConsumerCreateRequest(sub *subscription, c *client, a *Accoun
resp.ConsumerInfo = setDynamicConsumerInfoMetadata(o.initialInfo())
s.sendAPIResponse(ci, acc, subject, reply, string(msg), s.jsonResponse(resp))

o.mu.RLock()
if o.cfg.PauseUntil != nil && !o.cfg.PauseUntil.IsZero() && time.Now().Before(*o.cfg.PauseUntil) {
o.sendPauseAdvisoryLocked(&o.cfg)
}
o.mu.RUnlock()
}

// Request for the list of all consumer names.
Expand Down
2 changes: 2 additions & 0 deletions server/jetstream_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -5500,9 +5500,11 @@ func (js *jetStream) processConsumerLeaderChange(o *consumer, isLeader bool) err
// Only send a pause advisory on consumer create if we're
// actually paused. The timer would have been kicked by now
// by the call to o.setLeader() above.
o.mu.RLock()
if isLeader && o.cfg.PauseUntil != nil && !o.cfg.PauseUntil.IsZero() && time.Now().Before(*o.cfg.PauseUntil) {
o.sendPauseAdvisoryLocked(&o.cfg)
}
o.mu.RUnlock()

return nil
}
Expand Down
Loading