Commit a41127c6 authored by Yacov Manevich's avatar Yacov Manevich Committed by Gerrit Code Review
Browse files

Merge "[FAB-12919] Serialize `SendSubmit` invocation."

parents 968b3a92 50af08bd
......@@ -97,7 +97,10 @@ type Options struct {
// Chain implements consensus.Chain interface.
type Chain struct {
configurator Configurator
rpc RPC
// access to `SendSubmit` should be serialzed because gRPC is not thread-safe
submitLock sync.Mutex
rpc RPC
raftID uint64
channelID string
......@@ -389,6 +392,8 @@ func (c *Chain) Submit(req *orderer.SubmitRequest, sender uint64) error {
}
c.logger.Debugf("Forwarding submit request to Raft leader %d", lead)
c.submitLock.Lock()
defer c.submitLock.Unlock()
return c.rpc.SendSubmit(lead, req)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment