mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 11:24:44 -07:00
Fix for race and test for issue R.I. was seeing in nightly. Also fixed flappers.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -912,7 +912,10 @@ func (o *Consumer) deleteNotActive() {
|
||||
ticker := time.NewTicker(time.Second)
|
||||
defer ticker.Stop()
|
||||
for range ticker.C {
|
||||
if ca := js.consumerAssignment(acc, stream, name); ca != nil {
|
||||
js.mu.RLock()
|
||||
ca := js.consumerAssignment(acc, stream, name)
|
||||
js.mu.RUnlock()
|
||||
if ca != nil {
|
||||
s.Warnf("Consumer assignment not cleaned up, retrying")
|
||||
meta.ForwardProposal(removeEntry)
|
||||
} else {
|
||||
@@ -1053,9 +1056,9 @@ func (o *Consumer) updateDelivered(dseq, sseq, dc uint64, ts int64) {
|
||||
n += binary.PutUvarint(b[n:], dc)
|
||||
n += binary.PutVarint(b[n:], ts)
|
||||
o.node.Propose(b[:n])
|
||||
} else {
|
||||
o.store.UpdateDelivered(dseq, sseq, dc, ts)
|
||||
}
|
||||
// Update local state always.
|
||||
o.store.UpdateDelivered(dseq, sseq, dc, ts)
|
||||
}
|
||||
|
||||
// Lock should be held.
|
||||
|
||||
@@ -171,7 +171,7 @@ type lps struct {
|
||||
}
|
||||
|
||||
const (
|
||||
minElectionTimeout = 350 * time.Millisecond
|
||||
minElectionTimeout = 300 * time.Millisecond
|
||||
maxElectionTimeout = 3 * minElectionTimeout
|
||||
minCampaignTimeout = 50 * time.Millisecond
|
||||
maxCampaignTimeout = 4 * minCampaignTimeout
|
||||
|
||||
Reference in New Issue
Block a user