Skip to content

Commit a498cc6

Browse files
committed
[FAB-3666] Update chaincode.deploytimeout to duration
This CR updates the chaincode deploy timeout from an integer to a time duration. This has been done for consistency with other timeouts defined for the peer and orderer. Change-Id: Ib70c478e3d260cb988b862f1a448eedde963be2a Signed-off-by: Will Lahti <[email protected]>
1 parent a4c100c commit a498cc6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

core/chaincode/platforms/golang/package.go

+7
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ func getCodeFromHTTP(path string) (codegopath string, err error) {
113113
done <- cmd.Wait()
114114
}()
115115

116+
ccDeployTimeout := viper.GetDuration("chaincode.deploytimeout")
117+
if ccDeployTimeout < time.Duration(30)*time.Second {
118+
logger.Warningf("Invalid chaincode deploy timeout value %s (should be at least 30s); defaulting to 30s", ccDeployTimeout)
119+
ccDeployTimeout = time.Duration(30) * time.Second
120+
} else {
121+
logger.Debugf("Setting chaincode deploy timeout to %s", ccDeployTimeout)
122+
}
116123
select {
117124
case <-time.After(time.Duration(viper.GetInt("chaincode.deploytimeout")) * time.Millisecond):
118125
// If pulling repos takes too long, we should give up

sampleconfig/core.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ chaincode:
306306
# system chaincodes. Default is 30 seconds
307307
executetimeout: 30s
308308

309-
#timeout in millisecs for deploying chaincode from a remote repository.
310-
deploytimeout: 30000
309+
#timeout duration for deploying chaincode from a remote repository.
310+
deploytimeout: 30s
311311

312312
#mode - options are "dev", "net"
313313
#dev - in dev mode, user runs the chaincode after starting validator from

0 commit comments

Comments
 (0)