etcdserver: discard messages if sender reaches max serving
It is the correct thing to do to ensure that the communication is full of out-of-date messages. It results in that integration testing is very easy to throw MsgProp away, and makes client wait until 5 min timeout. Sync interval and heartbeat are increased to alleviate the traffic.
This commit is contained in:
@ -125,9 +125,11 @@ func newSender(u string, cid types.ID, c *http.Client, fs *stats.FollowerStats)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *sender) send(data []byte) {
|
func (s *sender) send(data []byte) {
|
||||||
// TODO: we cannot afford the miss of MsgProp, so we wait for some handler
|
select {
|
||||||
// to take the data
|
case s.q <- data:
|
||||||
s.q <- data
|
default:
|
||||||
|
log.Printf("sender: reach the maximal serving to %s", s.u)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *sender) stop() {
|
func (s *sender) stop() {
|
||||||
|
@ -36,7 +36,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
tickDuration = 5 * time.Millisecond
|
tickDuration = 10 * time.Millisecond
|
||||||
clusterName = "etcd"
|
clusterName = "etcd"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ func (m *member) Launch(t *testing.T) {
|
|||||||
t.Fatalf("failed to initialize the etcd server: %v", err)
|
t.Fatalf("failed to initialize the etcd server: %v", err)
|
||||||
}
|
}
|
||||||
m.s.Ticker = time.Tick(tickDuration)
|
m.s.Ticker = time.Tick(tickDuration)
|
||||||
m.s.SyncTicker = time.Tick(tickDuration)
|
m.s.SyncTicker = time.Tick(10 * tickDuration)
|
||||||
m.s.Start()
|
m.s.Start()
|
||||||
|
|
||||||
for _, ln := range m.PeerListeners {
|
for _, ln := range m.PeerListeners {
|
||||||
|
Reference in New Issue
Block a user