Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pubsub 2.0 #3227

Merged
merged 28 commits into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7268ec8
green pubsub tests :OK:
melekes Jan 29, 2019
c6e7015
get rid of clientToQueryMap
melekes Jan 30, 2019
67be801
Subscribe and SubscribeUnbuffered
melekes Jan 30, 2019
641182e
start adapting other pkgs to new pubsub
melekes Jan 30, 2019
54cc510
nope
melekes Jan 30, 2019
61155f6
rename MsgAndTags to Message
melekes Feb 1, 2019
1be7e34
remove TagMap
melekes Feb 1, 2019
4257407
bring back EventSubscriber
melekes Feb 1, 2019
17f1cb0
fix test
melekes Feb 1, 2019
d185bdb
fix data race in TestStartNextHeightCorrectly
melekes Feb 1, 2019
6464bcb
fixes after my own review
melekes Feb 2, 2019
c6e3059
fix formatting
melekes Feb 3, 2019
165bb2a
wait 100ms before kicking a subscriber out
melekes Feb 3, 2019
ebe8625
fixes after my second review
melekes Feb 3, 2019
cf67a8b
no timeout
melekes Feb 3, 2019
2e029e8
add changelog entries
melekes Feb 3, 2019
95dc174
fix merge conflicts
melekes Feb 7, 2019
b30cb5f
fix typos after Thane's review
thanethomson Feb 12, 2019
f1d63ed
Merge branch 'develop' into anton/new-pubsub
melekes Feb 13, 2019
545b33e
reformat code
melekes Feb 13, 2019
0d9107a
rewrite indexer service in the attempt to fix failing test
melekes Feb 13, 2019
3986265
Revert "rewrite indexer service in the attempt to fix failing test"
melekes Feb 13, 2019
5b7034a
another attempt to fix indexer
melekes Feb 13, 2019
6faf95e
fixes after Ethan's review
melekes Feb 21, 2019
5bc282b
use unbuffered channel when indexing transactions
melekes Feb 21, 2019
142469c
add a comment for EventBus#SubscribeUnbuffered
melekes Feb 21, 2019
6a76146
Merge branch 'develop' into anton/new-pubsub
melekes Feb 21, 2019
a52b6e9
format code
melekes Feb 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Special thanks to external contributors on this release:
### BREAKING CHANGES:

* CLI/RPC/Config
- [httpclient] Update Subscribe interface to reflect new pubsub/eventBus API [ADR-33](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-033-pubsub.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Subscribe interface change is breaking on the Go API, but the new behaviour of non-blocking send is breaking on the RPC since now clients need to be fast or they'll get cut!


* Apps

Expand All @@ -21,3 +22,4 @@ Special thanks to external contributors on this release:
### IMPROVEMENTS:

### BUG FIXES:
- [libs/pubsub] \#951, \#1880 use non-blocking send when dispatching messages [ADR-33](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-033-pubsub.md)
10 changes: 5 additions & 5 deletions consensus/byzantine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestByzantine(t *testing.T) {
switches[i].SetLogger(p2pLogger.With("validator", i))
}

eventChans := make([]chan interface{}, N)
blocksSubs := make([]types.Subscription, N)
reactors := make([]p2p.Reactor, N)
for i := 0; i < N; i++ {
// make first val byzantine
Expand All @@ -65,8 +65,8 @@ func TestByzantine(t *testing.T) {
eventBus := css[i].eventBus
eventBus.SetLogger(logger.With("module", "events", "validator", i))

eventChans[i] = make(chan interface{}, 1)
err := eventBus.Subscribe(context.Background(), testSubscriber, types.EventQueryNewBlock, eventChans[i])
var err error
blocksSubs[i], err = eventBus.Subscribe(context.Background(), testSubscriber, types.EventQueryNewBlock)
require.NoError(t, err)

conR := NewConsensusReactor(css[i], true) // so we dont start the consensus states
Expand Down Expand Up @@ -131,7 +131,7 @@ func TestByzantine(t *testing.T) {
p2p.Connect2Switches(switches, ind1, ind2)

// wait for someone in the big partition (B) to make a block
<-eventChans[ind2]
<-blocksSubs[ind2].Out()

t.Log("A block has been committed. Healing partition")
p2p.Connect2Switches(switches, ind0, ind1)
Expand All @@ -143,7 +143,7 @@ func TestByzantine(t *testing.T) {
wg.Add(2)
for i := 1; i < N-1; i++ {
go func(j int) {
<-eventChans[j]
<-blocksSubs[j].Out()
wg.Done()
}(i)
}
Expand Down