Skip to content

Commit 5628d8e

Browse files
committed
[FAB-3317] Update peer CouchDB timeout
Occasionally CouchDB doesn't respond for (exactly) 30s. This is most often seen in create database calls which happens frequently during unit tests. The default peer behavior was to retry couch after 20s, and therefore these occurrences disrupt unit tests and causes them to fail occasionally. This change will set the peer CouchDB timeout to 35s for now, in order to avoid the retries in the peer avoid the unit test problems. After the root problem in CouchDB is resolved, the default may change back to 20s. Change-Id: Id688e2e137b8354512b6543fc63ad3e59a1040eb Signed-off-by: denyeart <[email protected]>
1 parent 42bfa2e commit 5628d8e

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

core/chaincode/chaincodetest.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ ledger:
433433
# Number of retries for CouchDB errors during peer startup
434434
maxRetriesOnStartup: 10
435435
# CouchDB request timeout (unit: duration, e.g. 20s)
436-
requestTimeout: 20s
436+
requestTimeout: 35s
437437

438438

439439
# historyDatabase - options are true or false

core/ledger/kvledger/txmgmt/statedb/statecouchdb/statecouchdb_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestMain(m *testing.M) {
4848
viper.Set("ledger.state.couchDBConfig.password", "")
4949
viper.Set("ledger.state.couchDBConfig.maxRetries", 3)
5050
viper.Set("ledger.state.couchDBConfig.maxRetriesOnStartup", 10)
51-
viper.Set("ledger.state.couchDBConfig.requestTimeout", time.Second*20)
51+
viper.Set("ledger.state.couchDBConfig.requestTimeout", time.Second*35)
5252

5353
//run the actual test
5454
result := m.Run()

core/ledger/kvledger/txmgmt/txmgr/commontests/pkg_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (env *couchDBLockBasedEnv) init(t *testing.T, testLedgerID string) {
113113
viper.Set("ledger.state.couchDBConfig.password", "")
114114
viper.Set("ledger.state.couchDBConfig.maxRetries", 3)
115115
viper.Set("ledger.state.couchDBConfig.maxRetriesOnStartup", 10)
116-
viper.Set("ledger.state.couchDBConfig.requestTimeout", time.Second*20)
116+
viper.Set("ledger.state.couchDBConfig.requestTimeout", time.Second*35)
117117
testDBEnv := statecouchdb.NewTestVDBEnv(t)
118118
testDB, err := testDBEnv.DBProvider.GetDBHandle(testLedgerID)
119119
testutil.AssertNoError(t, err, "")

core/ledger/ledgerconfig/ledger_config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestGetCouchDBDefinition(t *testing.T) {
5757
testutil.AssertEquals(t, couchDBDef.Password, "")
5858
testutil.AssertEquals(t, couchDBDef.MaxRetries, 3)
5959
testutil.AssertEquals(t, couchDBDef.MaxRetriesOnStartup, 10)
60-
testutil.AssertEquals(t, couchDBDef.RequestTimeout, time.Second*20)
60+
testutil.AssertEquals(t, couchDBDef.RequestTimeout, time.Second*35)
6161
}
6262

6363
func TestIsHistoryDBEnabledDefault(t *testing.T) {

core/ledger/util/couchdb/couchdb_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func TestMain(m *testing.M) {
7878
viper.Set("ledger.state.couchDBConfig.password", "")
7979
viper.Set("ledger.state.couchDBConfig.maxRetries", 3)
8080
viper.Set("ledger.state.couchDBConfig.maxRetriesOnStartup", 10)
81-
viper.Set("ledger.state.couchDBConfig.requestTimeout", time.Second*20)
81+
viper.Set("ledger.state.couchDBConfig.requestTimeout", time.Second*35)
8282

8383
// Create CouchDB definition from config parameters
8484
couchDBDef = ledgerconfig.GetCouchDBDefinition()

peer/core.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ ledger:
389389
# Number of retries for CouchDB errors during peer startup
390390
maxRetriesOnStartup: 10
391391
# CouchDB request timeout (unit: duration, e.g. 20s)
392-
requestTimeout: 20s
392+
requestTimeout: 35s
393393

394394
# historyDatabase - options are true or false
395395
# Indicates if the history of key updates should be stored in goleveldb

0 commit comments

Comments
 (0)