Skip to content

Commit

Permalink
[FAB-1447] Broadcaster exits normally at EOF
Browse files Browse the repository at this point in the history
Make broadcast.(*broadcaster).queueEnvelopes() exits normally when
it detects io.EOF at receiving a message from a client.

If the orderer forwards io.EOF to a Node SDK client,
Orderer.sendBroadcast() fails due to the error.

I observed this error when I deploy a large chaincode with
BATCHSIZE=1.

Fix Issue # FAB-1447.
https://jira.hyperledger.org/browse/FAB-1447

Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
Change-Id: Icc6379bb04ceaab7ad463c0234d2419c34f8faca
  • Loading branch information
inatatsu committed Dec 28, 2016
1 parent b48f46d commit 4804471
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions orderer/common/broadcast/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
ab "github.com/hyperledger/fabric/protos/orderer"
"github.com/op/go-logging"

"io"

"github.com/golang/protobuf/proto"
)

Expand Down Expand Up @@ -118,6 +120,9 @@ func (b *broadcaster) queueEnvelopes(srv ab.AtomicBroadcast_BroadcastServer) err
default:
}
msg, err := srv.Recv()
if err == io.EOF {
return nil
}
if err != nil {
return err
}
Expand Down

0 comments on commit 4804471

Please sign in to comment.