mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
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:
parent
1e05cd75c7
commit
c3b0de943c
@ -125,9 +125,11 @@ func newSender(u string, cid types.ID, c *http.Client, fs *stats.FollowerStats)
|
||||
}
|
||||
|
||||
func (s *sender) send(data []byte) {
|
||||
// TODO: we cannot afford the miss of MsgProp, so we wait for some handler
|
||||
// to take the data
|
||||
s.q <- data
|
||||
select {
|
||||
case s.q <- data:
|
||||
default:
|
||||
log.Printf("sender: reach the maximal serving to %s", s.u)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *sender) stop() {
|
||||
|
@ -36,7 +36,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
tickDuration = 5 * time.Millisecond
|
||||
tickDuration = 10 * time.Millisecond
|
||||
clusterName = "etcd"
|
||||
)
|
||||
|
||||
@ -181,7 +181,7 @@ func (m *member) Launch(t *testing.T) {
|
||||
t.Fatalf("failed to initialize the etcd server: %v", err)
|
||||
}
|
||||
m.s.Ticker = time.Tick(tickDuration)
|
||||
m.s.SyncTicker = time.Tick(tickDuration)
|
||||
m.s.SyncTicker = time.Tick(10 * tickDuration)
|
||||
m.s.Start()
|
||||
|
||||
for _, ln := range m.PeerListeners {
|
||||
|
Loading…
x
Reference in New Issue
Block a user