Commit Graph

29 Commits (82ee796aa466b779703ff43c2bd72033db49147f)

Author SHA1 Message Date
Gyuho Lee 0850ccbf45 *: revert "internal/version" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 37546f74ab *: move "version" to "internal/version"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-29 10:00:20 -08:00
Gyu-Ho Lee d25f9feb19
rafthttp: bump up timeout in pipeline test
Fix https://github.com/coreos/etcd/issues/6283.

The timeout is too short. It could take more than 10ms
to send when the buffer gets full after 'pipelineBufSize' of
requests.
2016-12-30 09:46:16 -08:00
Xiang Li 0d35ba9b94 rafthttp: fix TestPipelineExceedMaximumServing
The timeout is too short. It might take more than 10ms to send
request over a blocking chan (buffer is full). Changing the timeout
to 1 second can fix this issue.
2016-09-13 19:06:11 +08:00
Anthony Romano da1e022890 rafthttp: remove WaitSchedule() from tests
Fixes #6187
2016-08-18 16:26:35 -07:00
Xiang Li a047aa4a81 rafthttp: rename to to peerID 2016-06-01 22:12:47 -07:00
Xiang Li efe0ee7e59 rafthttp: remove the newPipeline func
Using struct to initialize pipeline is better when we have many
fields to file in.
2016-05-30 16:19:50 -07:00
Gyu-Ho Lee bd71a60875 rafthttp: update LICENSE header 2016-05-12 20:49:28 -07:00
Xiang Li fb137f11c5 rafthttp: make TestPipelineKeepSendingWhenPostError reliable 2016-04-20 09:38:47 -07:00
Anthony Romano fe7cfe4d3d rafthttp: plumb local peer URLs through transport 2016-02-05 16:44:41 -08:00
Gyu-Ho Lee b6077f9d57 *: fix minor typos 2016-01-14 01:28:29 -08:00
Xiang Li 336d177c82 rafthttp: fix data races detected by go race detector 2015-10-26 15:29:08 -07:00
Yicheng Qin 4076dda101 rafthttp: fix wrong return in pipeline.handle
pipeline.handle is a long-living one, and should continue to receive
next message to send out when current message fails to send. So it
should `continue` instead of `return` here.
2015-10-26 14:05:19 -07:00
Yicheng Qin 61a75b3d48 rafthttp: always cancel in-flight request when pipeline.send
This fits the way for go1.5 to cancel request.
2015-08-25 09:07:49 -07:00
Brandon Philips 740187f199 *: docs and code %s%maximal%maximum%g
maximum is a more common word, use it instead
2015-06-22 16:06:57 -07:00
Yicheng Qin c21cc5b39b rafthttp: fix TestStopBlockedPipeline
Refactor the fake cancel implementation.

The old one may cancel other in-flight message in random, which leaves
the original target message blocked forever.
2015-06-12 07:55:12 -07:00
Yicheng Qin 0a3a2720a1 Merge pull request #2923 from yichengq/rafthttp-status
rafthttp: pretty print connection error
2015-06-10 16:17:07 -07:00
Yicheng Qin 1dbe72bb74 rafthttp: pretty print connection error
1. print out the status change of connection with peer
2. only print the first error for repeated ones
2015-06-10 15:43:49 -07:00
Yicheng Qin 018fb8e6d9 pkg/testutil: ForceGosched -> WaitSchedule
ForceGosched() performs bad when GOMAXPROCS>1. When GOMAXPROCS=1, it
could promise that other goroutines run long enough
because it always yield the processor to other goroutines. But it cannot
yield processor to goroutine running on other processors. So when
GOMAXPROCS>1, the yield may finish when goroutine on the other
processor just runs for little time.

Here is a test to confirm the case:

```
package main

import (
	"fmt"
	"runtime"
	"testing"
)

func ForceGosched() {
	// possibility enough to sched up to 10 go routines.
	for i := 0; i < 10000; i++ {
		runtime.Gosched()
	}
}

var d int

func loop(c chan struct{}) {
	for {
		select {
		case <-c:
			for i := 0; i < 1000; i++ {
				fmt.Sprintf("come to time %d", i)
			}
			d++
		}
	}
}

func TestLoop(t *testing.T) {
	c := make(chan struct{}, 1)
	go loop(c)
	c <- struct{}{}
	ForceGosched()
	if d != 1 {
		t.Fatal("d is not incremented")
	}
}
```

`go test -v -race` runs well, but `GOMAXPROCS=2 go test -v -race` fails.

Change the functionality to waiting for schedule to happen.
2015-06-10 14:37:41 -07:00
Yicheng Qin 7f8925e172 rafthttp: fix pipeline.stop may block
This PR makes pipeline.stop stop quickly. It cancels inflight requests,
and stops sending messages in the buffer.
2015-06-02 17:15:44 -07:00
Yicheng Qin c371d8c65c rafthttp: version enforcement on rafthttp messages
This PR sets etcd version and min cluster version in request header,
and let server check version compatibility. rafthttp server
will reject any message from peer with incompatible version(too low
version or too high version), and print out warning logs.
2015-06-02 13:33:18 -07:00
Xiang Li 0d3d4c5b01 rafthttp: print out log when clusterID mismatch instead of exiting
We have heard from several users that they do not expect a clusterID
mismatch to kill the cluster.
2015-05-26 16:05:58 -07:00
Yicheng Qin 38b8e848ac rafthttp: try stream msgappV1 handler if msgappV2 is unsupported
This helps etcd 2.1 connect to msgappV1 handler when the remote member
doesn't support msgappV2. And it doesn't print out unsupported handler
error to make log clean.
2015-05-26 14:52:41 -07:00
Alex Crawford d9ad6aa2a9 *: update to use IANA-assigned ports 2015-04-06 13:49:43 -07:00
Yicheng Qin 0fe9861197 rafthttp: support multiple peer urls 2015-03-04 15:00:07 -08:00
Yicheng Qin fc2d7019e5 rafthttp: {nopProcessor, errProcessor} -> fakeRaft 2015-03-02 13:31:56 -08:00
Yicheng Qin 9b986fb4c1 rafthttp: report unreachable status of the peer
When it failed to send message to the remote peer, it reports unreachable
to raft.
2015-03-01 16:48:26 -08:00
Yicheng Qin 1c5a507761 rafthttp: refactor peer and add general stream 2015-02-28 11:35:16 -08:00
Yicheng Qin d8a9e11e22 rafthttp: extract pipeline from peer 2015-02-28 11:06:11 -08:00