Skip to content

Commit

Permalink
Only send advisory on create if paused, only send advisory on update …
Browse files Browse the repository at this point in the history
…from leader

Signed-off-by: Neil Twigg <[email protected]>
  • Loading branch information
neilalexander committed Feb 14, 2024
1 parent c79c539 commit d773766
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,9 @@ func (mset *stream) addConsumerWithAssignment(config *ConsumerConfig, oname stri

// Check/update the pause state
o.updatePauseState(&o.cfg)
o.sendPauseAdvisoryLocked(&o.cfg)
if time.Now().Before(o.cfg.PauseUntil) {
o.sendPauseAdvisoryLocked(&o.cfg)
}

if o.isPushMode() {
// Check if we are running only 1 replica and that the delivery subject has interest.
Expand Down Expand Up @@ -1930,7 +1932,9 @@ func (o *consumer) updateConfig(cfg *ConsumerConfig) error {
}
if !cfg.PauseUntil.Equal(o.cfg.PauseUntil) {
o.updatePauseState(cfg)
o.sendPauseAdvisoryLocked(cfg)
if o.isLeader() {
o.sendPauseAdvisoryLocked(cfg)
}
}

// Check for Subject Filters update.
Expand Down

0 comments on commit d773766

Please sign in to comment.