Skip to content

Commit 578c7db

Browse files
committed
[FAB-10505] Memory coherent channel.Resources fetching
The discovery calls peer.GetChannelConfig to fetch the latest channelconfig.Resources object and extract from it the the Sequence() of the channel (the config block sequence). However, it might read a stale reference of the channelconfig.Resources because that reference is updated via an atomic pointer, while the peer.GetChannelConfig doesn't call an atomic load, but relies on the channels map's RLock which the callback that updates the map - doesn't lock. This can be easily solved via just calling GetStableChannelConfig instead of GetChannelConfig Change-Id: I7374ebdc8cb991d0c38a1d39e7f39c0e717dce63 Signed-off-by: yacovm <yacovm@il.ibm.com>
1 parent aa9150a commit 578c7db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

peer/node/start.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ func registerDiscoveryService(peerServer *comm.GRPCServer, polMgr policies.Chann
434434
localAccessPolicy = localPolicy(cauthdsl.SignedByAnyMember([]string{mspID}))
435435
}
436436
channelVerifier := discacl.NewChannelVerifier(policies.ChannelApplicationWriters, polMgr)
437-
acl := discacl.NewDiscoverySupport(channelVerifier, localAccessPolicy, discacl.ChannelConfigGetterFunc(peer.GetChannelConfig))
437+
acl := discacl.NewDiscoverySupport(channelVerifier, localAccessPolicy, discacl.ChannelConfigGetterFunc(peer.GetStableChannelConfig))
438438
gSup := gossip.NewDiscoverySupport(service.GetGossipService())
439439
ccSup := ccsupport.NewDiscoverySupport(lc)
440440
ea := endorsement.NewEndorsementAnalyzer(gSup, ccSup, acl, lc)

0 commit comments

Comments
 (0)