summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchris erway <51567+cce@users.noreply.github.com>2021-12-21 21:17:32 -0500
committerGitHub <noreply@github.com>2021-12-21 21:17:32 -0500
commit4cb424160db19b9412cedf81b248314084af545c (patch)
tree0d09a3eb649e9044e07c513a1abd0521f7d328f6
parent6be3ffa4d2a0499b3c407475338327e758e22132 (diff)
add config.DeadlockDetectionThreshold (#3339)
Summary This allows for the deadlock detection threshold to be set by configuration. Test Plan Existing tests should pass.
-rw-r--r--config/localTemplate.go5
-rw-r--r--config/local_defaults.go3
-rw-r--r--daemon/algod/server.go3
-rw-r--r--installer/config.json.example3
-rw-r--r--test/testdata/configs/config-v20.json98
5 files changed, 109 insertions, 3 deletions
diff --git a/config/localTemplate.go b/config/localTemplate.go
index 20a141e8c..977c8680d 100644
--- a/config/localTemplate.go
+++ b/config/localTemplate.go
@@ -41,7 +41,7 @@ type Local struct {
// Version tracks the current version of the defaults so we can migrate old -> new
// This is specifically important whenever we decide to change the default value
// for an existing parameter. This field tag must be updated any time we add a new version.
- Version uint32 `version[0]:"0" version[1]:"1" version[2]:"2" version[3]:"3" version[4]:"4" version[5]:"5" version[6]:"6" version[7]:"7" version[8]:"8" version[9]:"9" version[10]:"10" version[11]:"11" version[12]:"12" version[13]:"13" version[14]:"14" version[15]:"15" version[16]:"16" version[17]:"17" version[18]:"18" version[19]:"19"`
+ Version uint32 `version[0]:"0" version[1]:"1" version[2]:"2" version[3]:"3" version[4]:"4" version[5]:"5" version[6]:"6" version[7]:"7" version[8]:"8" version[9]:"9" version[10]:"10" version[11]:"11" version[12]:"12" version[13]:"13" version[14]:"14" version[15]:"15" version[16]:"16" version[17]:"17" version[18]:"18" version[19]:"19" version[20]:"20"`
// environmental (may be overridden)
// When enabled, stores blocks indefinitally, otherwise, only the most recents blocks
@@ -192,6 +192,9 @@ type Local struct {
// negative (-1) to disable, positive (1) to enable, 0 for default.
DeadlockDetection int `version[1]:"0"`
+ // The threshold used for deadlock detection, in seconds.
+ DeadlockDetectionThreshold int `version[20]:"30"`
+
// Prefer to run algod Hosted (under algoh)
// Observed by `goal` for now.
RunHosted bool `version[3]:"false"`
diff --git a/config/local_defaults.go b/config/local_defaults.go
index ae1aa7043..a1b6f33e7 100644
--- a/config/local_defaults.go
+++ b/config/local_defaults.go
@@ -20,7 +20,7 @@
package config
var defaultLocal = Local{
- Version: 19,
+ Version: 20,
AccountUpdatesStatsInterval: 5000000000,
AccountsRebuildSynchronousMode: 1,
AnnounceParticipationKey: true,
@@ -44,6 +44,7 @@ var defaultLocal = Local{
DNSBootstrapID: "<network>.algorand.network",
DNSSecurityFlags: 1,
DeadlockDetection: 0,
+ DeadlockDetectionThreshold: 30,
DisableLocalhostConnectionRateLimit: true,
DisableNetworking: false,
DisableOutgoingConnectionThrottling: false,
diff --git a/daemon/algod/server.go b/daemon/algod/server.go
index 1eedac466..775c5291a 100644
--- a/daemon/algod/server.go
+++ b/daemon/algod/server.go
@@ -98,6 +98,9 @@ func (s *Server) Initialize(cfg config.Local, phonebookAddresses []string, genes
// Default setting - host app should configure this
// If host doesn't, the default is Disable = false (so, enabled)
}
+ if !deadlock.Opts.Disable {
+ deadlock.Opts.DeadlockTimeout = time.Second * time.Duration(cfg.DeadlockDetectionThreshold)
+ }
// if we have the telemetry enabled, we want to use it's sessionid as part of the
// collected metrics decorations.
diff --git a/installer/config.json.example b/installer/config.json.example
index fac112201..3a77e301b 100644
--- a/installer/config.json.example
+++ b/installer/config.json.example
@@ -1,5 +1,5 @@
{
- "Version": 19,
+ "Version": 20,
"AccountUpdatesStatsInterval": 5000000000,
"AccountsRebuildSynchronousMode": 1,
"AnnounceParticipationKey": true,
@@ -23,6 +23,7 @@
"DNSBootstrapID": "<network>.algorand.network",
"DNSSecurityFlags": 1,
"DeadlockDetection": 0,
+ "DeadlockDetectionThreshold": 30,
"DisableLocalhostConnectionRateLimit": true,
"DisableNetworking": false,
"DisableOutgoingConnectionThrottling": false,
diff --git a/test/testdata/configs/config-v20.json b/test/testdata/configs/config-v20.json
new file mode 100644
index 000000000..3a77e301b
--- /dev/null
+++ b/test/testdata/configs/config-v20.json
@@ -0,0 +1,98 @@
+{
+ "Version": 20,
+ "AccountUpdatesStatsInterval": 5000000000,
+ "AccountsRebuildSynchronousMode": 1,
+ "AnnounceParticipationKey": true,
+ "Archival": false,
+ "BaseLoggerDebugLevel": 4,
+ "BlockServiceCustomFallbackEndpoints": "",
+ "BroadcastConnectionsLimit": -1,
+ "CadaverSizeTarget": 1073741824,
+ "CatchpointFileHistoryLength": 365,
+ "CatchpointInterval": 10000,
+ "CatchpointTracking": 0,
+ "CatchupBlockDownloadRetryAttempts": 1000,
+ "CatchupBlockValidateMode": 0,
+ "CatchupFailurePeerRefreshRate": 10,
+ "CatchupGossipBlockFetchTimeoutSec": 4,
+ "CatchupHTTPBlockFetchTimeoutSec": 4,
+ "CatchupLedgerDownloadRetryAttempts": 50,
+ "CatchupParallelBlocks": 16,
+ "ConnectionsRateLimitingCount": 60,
+ "ConnectionsRateLimitingWindowSeconds": 1,
+ "DNSBootstrapID": "<network>.algorand.network",
+ "DNSSecurityFlags": 1,
+ "DeadlockDetection": 0,
+ "DeadlockDetectionThreshold": 30,
+ "DisableLocalhostConnectionRateLimit": true,
+ "DisableNetworking": false,
+ "DisableOutgoingConnectionThrottling": false,
+ "EnableAccountUpdatesStats": false,
+ "EnableAgreementReporting": false,
+ "EnableAgreementTimeMetrics": false,
+ "EnableAssembleStats": false,
+ "EnableBlockService": false,
+ "EnableBlockServiceFallbackToArchiver": true,
+ "EnableCatchupFromArchiveServers": false,
+ "EnableDeveloperAPI": false,
+ "EnableGossipBlockService": true,
+ "EnableIncomingMessageFilter": false,
+ "EnableLedgerService": false,
+ "EnableMetricReporting": false,
+ "EnableOutgoingNetworkMessageFiltering": true,
+ "EnablePingHandler": true,
+ "EnableProcessBlockStats": false,
+ "EnableProfiler": false,
+ "EnableRequestLogger": false,
+ "EnableTopAccountsReporting": false,
+ "EnableVerbosedTransactionSyncLogging": false,
+ "EndpointAddress": "127.0.0.1:0",
+ "FallbackDNSResolverAddress": "",
+ "ForceFetchTransactions": false,
+ "ForceRelayMessages": false,
+ "GossipFanout": 4,
+ "IncomingConnectionsLimit": 800,
+ "IncomingMessageFilterBucketCount": 5,
+ "IncomingMessageFilterBucketSize": 512,
+ "IsIndexerActive": false,
+ "LedgerSynchronousMode": 2,
+ "LogArchiveMaxAge": "",
+ "LogArchiveName": "node.archive.log",
+ "LogSizeLimit": 1073741824,
+ "MaxCatchpointDownloadDuration": 7200000000000,
+ "MaxConnectionsPerIP": 30,
+ "MinCatchpointFileDownloadBytesPerSecond": 20480,
+ "NetAddress": "",
+ "NetworkMessageTraceServer": "",
+ "NetworkProtocolVersion": "",
+ "NodeExporterListenAddress": ":9100",
+ "NodeExporterPath": "./node_exporter",
+ "OptimizeAccountsDatabaseOnStartup": false,
+ "OutgoingMessageFilterBucketCount": 3,
+ "OutgoingMessageFilterBucketSize": 128,
+ "ParticipationKeysRefreshInterval": 60000000000,
+ "PeerConnectionsUpdateInterval": 3600,
+ "PeerPingPeriodSeconds": 0,
+ "PriorityPeers": {},
+ "ProposalAssemblyTime": 250000000,
+ "PublicAddress": "",
+ "ReconnectTime": 60000000000,
+ "ReservedFDs": 256,
+ "RestReadTimeoutSeconds": 15,
+ "RestWriteTimeoutSeconds": 120,
+ "RunHosted": false,
+ "SuggestedFeeBlockHistory": 3,
+ "SuggestedFeeSlidingWindowSize": 50,
+ "TLSCertFile": "",
+ "TLSKeyFile": "",
+ "TelemetryToLog": true,
+ "TransactionSyncDataExchangeRate": 0,
+ "TransactionSyncSignificantMessageThreshold": 0,
+ "TxPoolExponentialIncreaseFactor": 2,
+ "TxPoolSize": 15000,
+ "TxSyncIntervalSeconds": 60,
+ "TxSyncServeResponseSize": 1000000,
+ "TxSyncTimeoutSeconds": 30,
+ "UseXForwardedForAddressField": "",
+ "VerifiedTranscationsCacheSize": 30000
+}