Commit Graph

407 Commits

Author SHA1 Message Date
Anton Kaliaev 45750e1b29
fix race by sending signal instead of stopping pongTimer 2018-02-09 21:32:29 +04:00
Anton Kaliaev 26419fba28
refactor code plus add one more test
* extract stopPongTimer method
* TestMConnectionMultiplePings
2018-02-09 21:32:29 +04:00
Anton Kaliaev ac0123d249
drain pongTimeoutCh and pongTimer's channel to prevent leaks 2018-02-09 21:32:29 +04:00
Anton Kaliaev f4ff66de30
rewrite pong timer to use time.AfterFunc 2018-02-09 21:32:29 +04:00
Anton Kaliaev 747b73cb95
fix merge conflicts 2018-02-09 21:32:29 +04:00
Anton Kaliaev 161e100a24
close return channel when we're done
Benchmark results:

```
BenchmarkSwitchBroadcast-2         30000             71275 ns/op
--- BENCH: BenchmarkSwitchBroadcast-2
        switch_test.go:339: success: 1, failure: 0
        switch_test.go:339: success: 100, failure: 0
        switch_test.go:339: success: 10000, failure: 0
        switch_test.go:339: success: 30000, failure: 0
```
2018-02-09 21:32:29 +04:00
Anton Kaliaev 3ae738f453
increase timeouts 2018-02-09 21:32:29 +04:00
Anton Kaliaev d14d4a2527
remove TryBroadcast 2018-02-09 21:32:29 +04:00
Anton Kaliaev 860da464df
remove weird concurrency testing 2018-02-09 21:32:28 +04:00
Anton Kaliaev 4e2000abfe
control order by sending msgs from one goroutine 2018-02-09 21:32:28 +04:00
Anton Kaliaev 5834a59816
read ping 2018-02-09 21:32:28 +04:00
Anton Kaliaev b28b76ddf7
rename pingTimeout to pingInterval, pongTimer is now time.Timer 2018-02-09 21:32:28 +04:00
zbo14 91e4f4b786
ping/pong timeout in config 2018-02-09 21:32:28 +04:00
zbo14 9b554fb2c4
switch test modification 2018-02-09 21:32:28 +04:00
zbo14 f97ead4f5f
prep for merge 2018-02-09 21:32:28 +04:00
zbo14 5af22d6ee6
remove SwitchEventNewPeer, SwitchEventDonePeer 2018-02-09 21:32:28 +04:00
zbo14 1d16df6a92
add test, TrySend in broadcast 2018-02-09 21:32:27 +04:00
Ethan Buchman 199ea40980
Merge pull request #1196 from tendermint/1149-TestReactorValidatorSetChanges-fails-non-deterministically
WIP: TestReactorValidatorSetChanges fails non deterministically
2018-02-09 01:51:17 -05:00
Anton Kaliaev 3f9aa8d8fa
document that msgBytes in p2p/connection change 2018-02-08 13:25:26 +04:00
Anton Kaliaev d6d1f8512d
do not reset pingTimer
don't bother with this "only ping when we havent heard from them". lets
just always ping every peer from the sendRoutine every 10s no matter
what. if they dont pong within pongTimeout, disconnect :)
2018-02-08 13:08:11 +04:00
Anton Kaliaev 2b2c233977
write docs for Reactor interface 2018-02-08 13:07:40 +04:00
Ethan Buchman 7640e6a29f
add some p2p TODOs 2018-02-08 12:46:04 +04:00
Anton Kaliaev 11b68f1934
rewrite broadcastTxRoutine to use channels
https://play.golang.org/p/gN21yO9IRs3

```
func waitWithCancel(f func() *clist.CElement, ctx context.Context) *clist.CElement {
	el := make(chan *clist.CElement, 1)
	select {
	case el <- f():
```
will just run f() blockingly, so this doesn't change much in terms of behavior.
2018-02-05 16:36:26 +04:00
Ethan Buchman 426379dc47 remove use of wire/nowriter 2018-02-03 03:39:14 -05:00
Ethan Buchman baff4bd8cc p2p/conn: better handling for some stop conditions 2018-01-25 02:11:16 -05:00
Ethan Buchman 27ef3489a0
Merge pull request #1049 from tendermint/p2p-channels
p2p: add Channels to NodeInfo and don't send for unknown channels
2018-01-24 15:29:38 -05:00
Ethan Buchman b6eb275b22 p2p: fix break in double loop 2018-01-24 14:27:37 -05:00
Ethan Buchman 99034904f8 p2p: fix tests for required channels 2018-01-23 23:45:51 -05:00
Ethan Buchman d7b1b8d3d5
Merge pull request #1129 from tendermint/addrbook
p2p: bust up into sub dirs
2018-01-23 23:10:50 -05:00
Ethan Buchman 50129ad8ac p2p: add Channels to NodeInfo and don't send for unknown channels 2018-01-23 22:43:56 -05:00
Ethan Buchman 8f3bd3f209 p2p: addrBook.Save() on DialPeersAsync 2018-01-23 22:25:39 -05:00
Ethan Buchman 85816877c6 config: fix addrbook path to go in config 2018-01-23 22:21:17 -05:00
Ethan Buchman 775bb85efb p2p/pex: wait to connect to all peers in reactor test 2018-01-23 21:30:53 -05:00
Ethan Buchman 21ce5856b3 p2p: notes about ListenAddr 2018-01-23 21:26:19 -05:00
Ethan Buchman 3090b05eb4 p2p: use conn.Close when peer is nil 2018-01-21 16:26:59 -05:00
Ethan Buchman 44e967184a p2p: tmconn->conn and types->p2p 2018-01-21 00:34:41 -05:00
Ethan Buchman 0d7d16005a fixes 2018-01-20 21:44:30 -05:00
Ethan Buchman 5b5cbaa66a p2p: use sub dirs 2018-01-20 21:35:37 -05:00
Ethan Buchman 03550c7076 wip addrbook 2018-01-20 21:33:43 -05:00
Ethan Buchman 930fde056a p2p: add back lost func 2018-01-20 21:28:00 -05:00
Ethan Buchman 8d758560d8 p2p/trustmetric: non-deterministic test 2018-01-20 21:24:22 -05:00
Ethan Buchman 7b87cdaed8 p2p: seed disconnects after sending addrs 2018-01-20 21:24:22 -05:00
Ethan Buchman c2f97e6454 p2p: seed mode fixes from rebase and review 2018-01-20 21:24:22 -05:00
Ethan Buchman 88eb3e7af0 some minor renames 2018-01-20 21:24:20 -05:00
caffix 949211a137 added a test for PEX reactor seed mode 2018-01-20 21:23:48 -05:00
Ethan Buchman 8171628ee5 make tests run faster 2018-01-19 00:59:09 -05:00
Ethan Buchman bc19e7843c
Merge branch 'develop' into p2p-consolidate 2018-01-18 18:30:37 -05:00
Ethan Buchman fc7915ab4c fixes from review 2018-01-14 13:03:57 -05:00
Zach Ramsay 26aaa283a9 p2p: remove deprecated Dockerfile 2018-01-14 13:51:28 +00:00
Zach a29c67563c Update p2p README, closes #1102 2018-01-14 13:50:34 +00:00