mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
[FIXED] JetStream: sampling not updated during consumer update
Resolves #2941 Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -1350,6 +1350,13 @@ func (o *consumer) updateConfig(cfg *ConsumerConfig) error {
|
||||
// We need both locks here so do in Go routine.
|
||||
go o.setRateLimitNeedsLocks()
|
||||
}
|
||||
if cfg.SampleFrequency != o.cfg.SampleFrequency {
|
||||
s := strings.TrimSuffix(cfg.SampleFrequency, "%")
|
||||
// String has been already verified for validity up in the stack, so no
|
||||
// need to check for error here.
|
||||
sampleFreq, _ := strconv.Atoi(s)
|
||||
o.sfreq = int32(sampleFreq)
|
||||
}
|
||||
|
||||
// Record new config for others that do not need special handling.
|
||||
// Allowed but considered no-op, [Description, MaxDeliver, SampleFrequency, MaxWaiting, HeadersOnly]
|
||||
|
||||
@@ -16080,8 +16080,6 @@ func TestJetStreamConsumerAckSampling(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestJetStreamConsumerAckSamplingSpecifiedUsingUpdateConsumer(t *testing.T) {
|
||||
t.Skip("sampling msg is not sent when sampling option is part of update flow")
|
||||
|
||||
s := RunBasicJetStreamServer()
|
||||
if config := s.JetStreamConfig(); config != nil {
|
||||
defer removeDir(t, config.StoreDir)
|
||||
|
||||
Reference in New Issue
Block a user