planetarium / NineChronicles.Headless

A headless node of NineChronicles game network, powered by Libplanet.
https://planetarium.github.io/NineChronicles.Headless/
GNU Affero General Public License v3.0
35 stars 37 forks source link

prevent headless from stopping when acc redis is down #2543

Closed area363 closed 3 weeks ago

area363 commented 3 weeks ago

When acc env value is added to the headless configuration, the headless operation completely stops when acc is down. Adding AbortOnConnectFail = false enables headless operation to continue even when acc is down. It also retries connection automatically so that it will reconnect to acc when it is back up.

Error message:

StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). Error connecting right now. To allow this multiplexer to continue retrying until it's able to connect, use abortConnect=false in your connection string or AbortOnConnectFail=false; in your code.
   at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(ConfigurationOptions configuration, TextWriter log, Nullable`1 serverType, EndPointCollection endpoints) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 708
   at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 673
   at NineChronicles.Headless.Services.RedisAccessControlService..ctor(String storageUri) in /app/NineChronicles.Headless/Services/RedisAccessControlService.cs:line 23
   at NineChronicles.Headless.Services.AccessControlServiceFactory.Create(StorageType storageType, String connectionString) in /app/NineChronicles.Headless/Services/AccessControlServiceFactory.cs:line 33
   at NineChronicles.Headless.NineChroniclesNodeService..ctor(PrivateKey minerPrivateKey, LibplanetNodeServiceProperties properties, IBlockPolicy blockPolicy, Planet planet, IActionLoader actionLoader, Progress`1 preloadProgress, Boolean ignoreBootstrapFailure, Boolean ignorePreloadFailure, Boolean strictRendering, TimeSpan txLifeTime, Int32 txQuotaPerSigner, AccessControlServiceOptions acsOptions) in /app/NineChronicles.Headless/NineChroniclesNodeService.cs:line 98
   at NineChronicles.Headless.NineChroniclesNodeService.Create(NineChroniclesNodeServiceProperties properties, StandaloneContext context) in /app/NineChronicles.Headless/NineChroniclesNodeService.cs:line 212
   at NineChronicles.Headless.Executable.Program.Run(String appProtocolVersionToken, String genesisBlockPath, String host, Nullable`1 port, String swarmPrivateKeyString, Nullable`1 noMiner, Nullable`1 minerCount, String minerPrivateKeyString, Nullable`1 minerBlockIntervalMilliseconds, String storeType, String storePath, Nullable`1 noReduceStore, String[] iceServerStrings, String[] peerStrings, String[] trustedAppProtocolVersionSigners, Nullable`1 rpcServer, String rpcListenHost, Nullable`1 rpcListenPort, Nullable`1 rpcRemoteServer, Nullable`1 rpcHttpServer, Nullable`1 graphQLServer, String graphQLHost, Nullable`1 graphQLPort, String graphQLSecretTokenPath, Nullable`1 noCors, Nullable`1 confirmations, Nullable`1 nonblockRenderer, Nullable`1 nonblockRendererQueue, Nullable`1 strictRendering, Nullable`1 logActionRenders, String networkType, Nullable`1 planet, Nullable`1 txLifeTime, Nullable`1 messageTimeout, Nullable`1 tipTimeout, Nullable`1 demandBuffer, String[] staticPeerStrings, Nullable`1 skipPreload, Nullable`1 minimumBroadcastTarget, Nullable`1 bucketSize, String chainTipStaleBehaviorType, Nullable`1 txQuotaPerSigner, Nullable`1 maximumPollPeers, Nullable`1 consensusPort, String consensusPrivateKeyString, String[] consensusSeedStrings, Nullable`1 consensusTargetBlockIntervalMilliseconds, Nullable`1 consensusProposeSecondBase, Nullable`1 maxTransactionPerBlock, String configPath, Nullable`1 arenaParticipantsSyncInterval, Boolean arenaParticipantsSync, Boolean remoteKeyValueService, Nullable`1 cancellationToken) in /app/NineChronicles.Headless.Executable/Program.cs:line 483