From f1c67653a077bae932eff977fe0302bd34c41584 Mon Sep 17 00:00:00 2001 From: Yichao Yang Date: Mon, 2 Jan 2023 14:37:53 -0800 Subject: [PATCH 1/2] Remove task max retry count config --- common/dynamicconfig/constants.go | 10 ---------- service/history/archival_queue_factory.go | 1 - service/history/archival_queue_task_executor_test.go | 1 - service/history/configs/config.go | 10 ---------- service/history/queues/executable.go | 9 ++++----- service/history/queues/executable_test.go | 2 -- service/history/queues/queue_base.go | 2 -- service/history/queues/queue_base_test.go | 1 - service/history/queues/reader_test.go | 2 +- service/history/queues/slice_test.go | 2 +- service/history/timerQueueActiveTaskExecutor_test.go | 1 - service/history/timerQueueFactory.go | 1 - service/history/timerQueueStandbyTaskExecutor_test.go | 1 - .../history/transferQueueActiveTaskExecutor_test.go | 1 - service/history/transferQueueFactory.go | 1 - .../history/transferQueueStandbyTaskExecutor_test.go | 1 - service/history/visibilityQueueFactory.go | 1 - service/history/visibilityQueueTaskExecutor_test.go | 1 - 18 files changed, 6 insertions(+), 42 deletions(-) diff --git a/common/dynamicconfig/constants.go b/common/dynamicconfig/constants.go index a29e6a369dc..e0092169d70 100644 --- a/common/dynamicconfig/constants.go +++ b/common/dynamicconfig/constants.go @@ -387,8 +387,6 @@ const ( // TimerTaskBatchSize is batch size for timer processor to process tasks TimerTaskBatchSize = "history.timerTaskBatchSize" - // TimerTaskMaxRetryCount is max retry count for timer processor - TimerTaskMaxRetryCount = "history.timerTaskMaxRetryCount" // TimerProcessorSchedulerWorkerCount is the number of workers in the host level task scheduler for timer processor TimerProcessorSchedulerWorkerCount = "history.timerProcessorSchedulerWorkerCount" // TimerProcessorSchedulerActiveRoundRobinWeights is the priority round robin weights used by timer task scheduler for active namespaces @@ -432,8 +430,6 @@ const ( TransferProcessorMaxPollRPS = "history.transferProcessorMaxPollRPS" // TransferProcessorMaxPollHostRPS is max poll rate per second for all transferQueueProcessor on a host TransferProcessorMaxPollHostRPS = "history.transferProcessorMaxPollHostRPS" - // TransferTaskMaxRetryCount is max times of retry for transferQueueProcessor - TransferTaskMaxRetryCount = "history.transferTaskMaxRetryCount" // TransferProcessorSchedulerWorkerCount is the number of workers in the host level task scheduler for transferQueueProcessor TransferProcessorSchedulerWorkerCount = "history.transferProcessorSchedulerWorkerCount" // TransferProcessorSchedulerActiveRoundRobinWeights is the priority round robin weights used by transfer task scheduler for active namespaces @@ -467,8 +463,6 @@ const ( VisibilityProcessorMaxPollRPS = "history.visibilityProcessorMaxPollRPS" // VisibilityProcessorMaxPollHostRPS is max poll rate per second for all visibilityQueueProcessor on a host VisibilityProcessorMaxPollHostRPS = "history.visibilityProcessorMaxPollHostRPS" - // VisibilityTaskMaxRetryCount is max times of retry for visibilityQueueProcessor - VisibilityTaskMaxRetryCount = "history.visibilityTaskMaxRetryCount" // VisibilityProcessorSchedulerWorkerCount is the number of workers in the host level task scheduler for visibilityQueueProcessor VisibilityProcessorSchedulerWorkerCount = "history.visibilityProcessorSchedulerWorkerCount" // VisibilityProcessorSchedulerActiveRoundRobinWeights is the priority round robin weights by visibility task scheduler for active namespaces @@ -520,8 +514,6 @@ const ( ArchivalProcessorPollBackoffInterval = "history.archivalProcessorPollBackoffInterval" // ArchivalProcessorArchiveDelay is the delay before archivalQueueProcessor starts to process archival tasks ArchivalProcessorArchiveDelay = "history.archivalProcessorArchiveDelay" - // ArchivalProcessorRetryWarningLimit is the number of times an archival task may be retried before we log a warning - ArchivalProcessorRetryWarningLimit = "history.archivalProcessorRetryLimitWarning" // ArchivalBackendMaxRPS is the maximum rate of requests per second to the archival backend ArchivalBackendMaxRPS = "history.archivalBackendMaxRPS" // DurableArchivalEnabled is the flag to enable durable archival @@ -533,8 +525,6 @@ const ( ReplicatorMaxSkipTaskCount = "history.replicatorMaxSkipTaskCount" // ReplicatorTaskWorkerCount is number of worker for ReplicatorProcessor ReplicatorTaskWorkerCount = "history.replicatorTaskWorkerCount" - // ReplicatorTaskMaxRetryCount is max times of retry for ReplicatorProcessor - ReplicatorTaskMaxRetryCount = "history.replicatorTaskMaxRetryCount" // ReplicatorProcessorMaxPollRPS is max poll rate per second for ReplicatorProcessor ReplicatorProcessorMaxPollRPS = "history.replicatorProcessorMaxPollRPS" // ReplicatorProcessorMaxPollInterval is max poll interval for ReplicatorProcessor diff --git a/service/history/archival_queue_factory.go b/service/history/archival_queue_factory.go index 194cc526313..1716cb65dc6 100644 --- a/service/history/archival_queue_factory.go +++ b/service/history/archival_queue_factory.go @@ -175,7 +175,6 @@ func (f *archivalQueueFactory) newScheduledQueue(shard shard.Context, executor q CheckpointInterval: f.Config.ArchivalProcessorUpdateAckInterval, CheckpointIntervalJitterCoefficient: f.Config.ArchivalProcessorUpdateAckIntervalJitterCoefficient, MaxReaderCount: f.Config.QueueMaxReaderCount, - TaskMaxRetryCount: f.Config.ArchivalProcessorRetryWarningLimit, }, f.HostReaderRateLimiter, logger, diff --git a/service/history/archival_queue_task_executor_test.go b/service/history/archival_queue_task_executor_test.go index 8277573cca9..3b01553fcad 100644 --- a/service/history/archival_queue_task_executor_test.go +++ b/service/history/archival_queue_task_executor_test.go @@ -511,7 +511,6 @@ func TestArchivalQueueTaskExecutor(t *testing.T) { namespaceRegistry, nil, metrics.NoopMetricsHandler, - nil, ) err := executable.Execute() if len(p.ExpectedErrorSubstrings) > 0 { diff --git a/service/history/configs/config.go b/service/history/configs/config.go index bd04e16da97..08a56321294 100644 --- a/service/history/configs/config.go +++ b/service/history/configs/config.go @@ -98,7 +98,6 @@ type Config struct { // TimerQueueProcessor settings TimerTaskHighPriorityRPS dynamicconfig.IntPropertyFnWithNamespaceFilter TimerTaskBatchSize dynamicconfig.IntPropertyFn - TimerTaskMaxRetryCount dynamicconfig.IntPropertyFn TimerProcessorSchedulerWorkerCount dynamicconfig.IntPropertyFn TimerProcessorSchedulerActiveRoundRobinWeights dynamicconfig.MapPropertyFnWithNamespaceFilter TimerProcessorSchedulerStandbyRoundRobinWeights dynamicconfig.MapPropertyFnWithNamespaceFilter @@ -120,7 +119,6 @@ type Config struct { // TransferQueueProcessor settings TransferTaskHighPriorityRPS dynamicconfig.IntPropertyFnWithNamespaceFilter TransferTaskBatchSize dynamicconfig.IntPropertyFn - TransferTaskMaxRetryCount dynamicconfig.IntPropertyFn TransferProcessorSchedulerWorkerCount dynamicconfig.IntPropertyFn TransferProcessorSchedulerActiveRoundRobinWeights dynamicconfig.MapPropertyFnWithNamespaceFilter TransferProcessorSchedulerStandbyRoundRobinWeights dynamicconfig.MapPropertyFnWithNamespaceFilter @@ -141,7 +139,6 @@ type Config struct { // TODO: clean up unused replicator settings ReplicatorTaskBatchSize dynamicconfig.IntPropertyFn ReplicatorTaskWorkerCount dynamicconfig.IntPropertyFn - ReplicatorTaskMaxRetryCount dynamicconfig.IntPropertyFn ReplicatorProcessorMaxPollRPS dynamicconfig.IntPropertyFn ReplicatorProcessorMaxPollInterval dynamicconfig.DurationPropertyFn ReplicatorProcessorMaxPollIntervalJitterCoefficient dynamicconfig.FloatPropertyFn @@ -252,7 +249,6 @@ type Config struct { // VisibilityQueueProcessor settings VisibilityTaskHighPriorityRPS dynamicconfig.IntPropertyFnWithNamespaceFilter VisibilityTaskBatchSize dynamicconfig.IntPropertyFn - VisibilityTaskMaxRetryCount dynamicconfig.IntPropertyFn VisibilityProcessorSchedulerWorkerCount dynamicconfig.IntPropertyFn VisibilityProcessorSchedulerActiveRoundRobinWeights dynamicconfig.MapPropertyFnWithNamespaceFilter VisibilityProcessorSchedulerStandbyRoundRobinWeights dynamicconfig.MapPropertyFnWithNamespaceFilter @@ -294,7 +290,6 @@ type Config struct { ArchivalProcessorUpdateAckInterval dynamicconfig.DurationPropertyFn ArchivalProcessorUpdateAckIntervalJitterCoefficient dynamicconfig.FloatPropertyFn ArchivalProcessorArchiveDelay dynamicconfig.DurationPropertyFn - ArchivalProcessorRetryWarningLimit dynamicconfig.IntPropertyFn ArchivalBackendMaxRPS dynamicconfig.FloatPropertyFn } @@ -354,7 +349,6 @@ func NewConfig(dc *dynamicconfig.Collection, numberOfShards int32, isAdvancedVis TaskSchedulerNamespaceMaxQPS: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.TaskSchedulerNamespaceMaxQPS, 0), TimerTaskBatchSize: dc.GetIntProperty(dynamicconfig.TimerTaskBatchSize, 100), - TimerTaskMaxRetryCount: dc.GetIntProperty(dynamicconfig.TimerTaskMaxRetryCount, 20), TimerProcessorSchedulerWorkerCount: dc.GetIntProperty(dynamicconfig.TimerProcessorSchedulerWorkerCount, 512), TimerProcessorSchedulerActiveRoundRobinWeights: dc.GetMapPropertyFnWithNamespaceFilter(dynamicconfig.TimerProcessorSchedulerActiveRoundRobinWeights, ConvertWeightsToDynamicConfigValue(DefaultActiveTaskPriorityWeight)), TimerProcessorSchedulerStandbyRoundRobinWeights: dc.GetMapPropertyFnWithNamespaceFilter(dynamicconfig.TimerProcessorSchedulerStandbyRoundRobinWeights, ConvertWeightsToDynamicConfigValue(DefaultStandbyTaskPriorityWeight)), @@ -374,7 +368,6 @@ func NewConfig(dc *dynamicconfig.Collection, numberOfShards int32, isAdvancedVis RetentionTimerJitterDuration: dc.GetDurationProperty(dynamicconfig.RetentionTimerJitterDuration, 30*time.Minute), TransferTaskBatchSize: dc.GetIntProperty(dynamicconfig.TransferTaskBatchSize, 100), - TransferTaskMaxRetryCount: dc.GetIntProperty(dynamicconfig.TransferTaskMaxRetryCount, 20), TransferProcessorSchedulerWorkerCount: dc.GetIntProperty(dynamicconfig.TransferProcessorSchedulerWorkerCount, 512), TransferProcessorSchedulerActiveRoundRobinWeights: dc.GetMapPropertyFnWithNamespaceFilter(dynamicconfig.TransferProcessorSchedulerActiveRoundRobinWeights, ConvertWeightsToDynamicConfigValue(DefaultActiveTaskPriorityWeight)), TransferProcessorSchedulerStandbyRoundRobinWeights: dc.GetMapPropertyFnWithNamespaceFilter(dynamicconfig.TransferProcessorSchedulerStandbyRoundRobinWeights, ConvertWeightsToDynamicConfigValue(DefaultStandbyTaskPriorityWeight)), @@ -393,7 +386,6 @@ func NewConfig(dc *dynamicconfig.Collection, numberOfShards int32, isAdvancedVis ReplicatorTaskBatchSize: dc.GetIntProperty(dynamicconfig.ReplicatorTaskBatchSize, 100), ReplicatorTaskWorkerCount: dc.GetIntProperty(dynamicconfig.ReplicatorTaskWorkerCount, 10), - ReplicatorTaskMaxRetryCount: dc.GetIntProperty(dynamicconfig.ReplicatorTaskMaxRetryCount, 100), ReplicatorProcessorMaxPollRPS: dc.GetIntProperty(dynamicconfig.ReplicatorProcessorMaxPollRPS, 20), ReplicatorProcessorMaxPollInterval: dc.GetDurationProperty(dynamicconfig.ReplicatorProcessorMaxPollInterval, 1*time.Minute), ReplicatorProcessorMaxPollIntervalJitterCoefficient: dc.GetFloat64Property(dynamicconfig.ReplicatorProcessorMaxPollIntervalJitterCoefficient, 0.15), @@ -476,7 +468,6 @@ func NewConfig(dc *dynamicconfig.Collection, numberOfShards int32, isAdvancedVis VisibilityTaskBatchSize: dc.GetIntProperty(dynamicconfig.VisibilityTaskBatchSize, 100), VisibilityProcessorMaxPollRPS: dc.GetIntProperty(dynamicconfig.VisibilityProcessorMaxPollRPS, 20), VisibilityProcessorMaxPollHostRPS: dc.GetIntProperty(dynamicconfig.VisibilityProcessorMaxPollHostRPS, 0), - VisibilityTaskMaxRetryCount: dc.GetIntProperty(dynamicconfig.VisibilityTaskMaxRetryCount, 20), VisibilityProcessorSchedulerWorkerCount: dc.GetIntProperty(dynamicconfig.VisibilityProcessorSchedulerWorkerCount, 512), VisibilityProcessorSchedulerActiveRoundRobinWeights: dc.GetMapPropertyFnWithNamespaceFilter(dynamicconfig.VisibilityProcessorSchedulerActiveRoundRobinWeights, ConvertWeightsToDynamicConfigValue(DefaultActiveTaskPriorityWeight)), VisibilityProcessorSchedulerStandbyRoundRobinWeights: dc.GetMapPropertyFnWithNamespaceFilter(dynamicconfig.VisibilityProcessorSchedulerStandbyRoundRobinWeights, ConvertWeightsToDynamicConfigValue(DefaultStandbyTaskPriorityWeight)), @@ -522,7 +513,6 @@ func NewConfig(dc *dynamicconfig.Collection, numberOfShards int32, isAdvancedVis ArchivalProcessorUpdateAckIntervalJitterCoefficient, 0.15), ArchivalProcessorPollBackoffInterval: dc.GetDurationProperty(dynamicconfig.ArchivalProcessorPollBackoffInterval, 5*time.Second), ArchivalProcessorArchiveDelay: dc.GetDurationProperty(dynamicconfig.ArchivalProcessorArchiveDelay, 5*time.Minute), - ArchivalProcessorRetryWarningLimit: dc.GetIntProperty(dynamicconfig.ArchivalProcessorRetryWarningLimit, 100), ArchivalBackendMaxRPS: dc.GetFloat64Property(dynamicconfig.ArchivalBackendMaxRPS, 10000.0), } diff --git a/service/history/queues/executable.go b/service/history/queues/executable.go index e2a7fc7dbf8..e96915a294e 100644 --- a/service/history/queues/executable.go +++ b/service/history/queues/executable.go @@ -36,7 +36,6 @@ import ( "go.temporal.io/server/common" "go.temporal.io/server/common/backoff" "go.temporal.io/server/common/clock" - "go.temporal.io/server/common/dynamicconfig" "go.temporal.io/server/common/headers" "go.temporal.io/server/common/log" "go.temporal.io/server/common/log/tag" @@ -90,6 +89,9 @@ const ( // resourceExhaustedResubmitMaxAttempts is the same as resubmitMaxAttempts but only applies to resource // exhausted error resourceExhaustedResubmitMaxAttempts = 1 + // taskCriticalAttempts, if exceeded, task attempts metrics and critical processing error log will be emitted + // while task is retrying + taskCriticalAttempts = 30 ) type ( @@ -118,7 +120,6 @@ type ( logger log.Logger metricsHandler metrics.Handler taggedMetricsHandler metrics.Handler - criticalRetryAttempt dynamicconfig.IntPropertyFn } ) @@ -136,7 +137,6 @@ func NewExecutable( namespaceRegistry namespace.Registry, logger log.Logger, metricsHandler metrics.Handler, - criticalRetryAttempt dynamicconfig.IntPropertyFn, ) Executable { executable := &executableImpl{ Task: task, @@ -158,7 +158,6 @@ func NewExecutable( ), metricsHandler: metricsHandler, taggedMetricsHandler: metricsHandler, - criticalRetryAttempt: criticalRetryAttempt, } executable.updatePriority() return executable @@ -209,7 +208,7 @@ func (e *executableImpl) HandleErr(err error) (retErr error) { defer e.Unlock() e.attempt++ - if e.attempt > e.criticalRetryAttempt() { + if e.attempt > taskCriticalAttempts { e.taggedMetricsHandler.Histogram(metrics.TaskAttempt.GetMetricName(), metrics.TaskAttempt.GetMetricUnit()).Record(int64(e.attempt)) e.logger.Error("Critical error processing task, retrying.", tag.Error(err), tag.OperationCritical) } diff --git a/service/history/queues/executable_test.go b/service/history/queues/executable_test.go index ed7081a75eb..3a631b422c3 100644 --- a/service/history/queues/executable_test.go +++ b/service/history/queues/executable_test.go @@ -38,7 +38,6 @@ import ( "go.temporal.io/server/common/clock" "go.temporal.io/server/common/definition" - "go.temporal.io/server/common/dynamicconfig" "go.temporal.io/server/common/log" "go.temporal.io/server/common/metrics" "go.temporal.io/server/common/namespace" @@ -222,6 +221,5 @@ func (s *executableSuite) newTestExecutable() Executable { s.mockNamespaceRegistry, log.NewTestLogger(), metrics.NoopMetricsHandler, - dynamicconfig.GetIntPropertyFn(100), ) } diff --git a/service/history/queues/queue_base.go b/service/history/queues/queue_base.go index 0446eb96efe..01813a8a51a 100644 --- a/service/history/queues/queue_base.go +++ b/service/history/queues/queue_base.go @@ -116,7 +116,6 @@ type ( CheckpointInterval dynamicconfig.DurationPropertyFn CheckpointIntervalJitterCoefficient dynamicconfig.FloatPropertyFn MaxReaderCount dynamicconfig.IntPropertyFn - TaskMaxRetryCount dynamicconfig.IntPropertyFn } ) @@ -172,7 +171,6 @@ func newQueueBase( shard.GetNamespaceRegistry(), logger, metricsHandler, - options.TaskMaxRetryCount, ) } diff --git a/service/history/queues/queue_base_test.go b/service/history/queues/queue_base_test.go index 186b5967e46..cd1702aa237 100644 --- a/service/history/queues/queue_base_test.go +++ b/service/history/queues/queue_base_test.go @@ -85,7 +85,6 @@ var testQueueOptions = &Options{ CheckpointInterval: dynamicconfig.GetDurationPropertyFn(100 * time.Millisecond), CheckpointIntervalJitterCoefficient: dynamicconfig.GetFloatPropertyFn(0.15), MaxReaderCount: dynamicconfig.GetIntPropertyFn(5), - TaskMaxRetryCount: dynamicconfig.GetIntPropertyFn(100), } func TestQueueBaseSuite(t *testing.T) { diff --git a/service/history/queues/reader_test.go b/service/history/queues/reader_test.go index 87dbd9a1df0..0f50fbb461b 100644 --- a/service/history/queues/reader_test.go +++ b/service/history/queues/reader_test.go @@ -77,7 +77,7 @@ func (s *readerSuite) SetupTest() { s.metricsHandler = metrics.NoopMetricsHandler s.executableInitializer = func(readerID int32, t tasks.Task) Executable { - return NewExecutable(readerID, t, nil, nil, nil, NewNoopPriorityAssigner(), clock.NewRealTimeSource(), nil, nil, metrics.NoopMetricsHandler, nil) + return NewExecutable(readerID, t, nil, nil, nil, NewNoopPriorityAssigner(), clock.NewRealTimeSource(), nil, nil, metrics.NoopMetricsHandler) } s.monitor = newMonitor(tasks.CategoryTypeScheduled, &MonitorOptions{ PendingTasksCriticalCount: dynamicconfig.GetIntPropertyFn(1000), diff --git a/service/history/queues/slice_test.go b/service/history/queues/slice_test.go index 59c6622536f..732f70a9a4c 100644 --- a/service/history/queues/slice_test.go +++ b/service/history/queues/slice_test.go @@ -69,7 +69,7 @@ func (s *sliceSuite) SetupTest() { s.controller = gomock.NewController(s.T()) s.executableInitializer = func(readerID int32, t tasks.Task) Executable { - return NewExecutable(readerID, t, nil, nil, nil, NewNoopPriorityAssigner(), clock.NewRealTimeSource(), nil, nil, metrics.NoopMetricsHandler, nil) + return NewExecutable(readerID, t, nil, nil, nil, NewNoopPriorityAssigner(), clock.NewRealTimeSource(), nil, nil, metrics.NoopMetricsHandler) } s.monitor = newMonitor(tasks.CategoryTypeScheduled, &MonitorOptions{ PendingTasksCriticalCount: dynamicconfig.GetIntPropertyFn(1000), diff --git a/service/history/timerQueueActiveTaskExecutor_test.go b/service/history/timerQueueActiveTaskExecutor_test.go index 5fbd676d31e..20cf546931a 100644 --- a/service/history/timerQueueActiveTaskExecutor_test.go +++ b/service/history/timerQueueActiveTaskExecutor_test.go @@ -1482,6 +1482,5 @@ func (s *timerQueueActiveTaskExecutorSuite) newTaskExecutable( nil, nil, metrics.NoopMetricsHandler, - nil, ) } diff --git a/service/history/timerQueueFactory.go b/service/history/timerQueueFactory.go index 7e6616d7193..bfd25d99cf2 100644 --- a/service/history/timerQueueFactory.go +++ b/service/history/timerQueueFactory.go @@ -189,7 +189,6 @@ func (f *timerQueueFactory) CreateQueue( CheckpointInterval: f.Config.TimerProcessorUpdateAckInterval, CheckpointIntervalJitterCoefficient: f.Config.TimerProcessorUpdateAckIntervalJitterCoefficient, MaxReaderCount: f.Config.QueueMaxReaderCount, - TaskMaxRetryCount: f.Config.TimerTaskMaxRetryCount, }, f.HostReaderRateLimiter, logger, diff --git a/service/history/timerQueueStandbyTaskExecutor_test.go b/service/history/timerQueueStandbyTaskExecutor_test.go index a8a7bb03339..18da182288d 100644 --- a/service/history/timerQueueStandbyTaskExecutor_test.go +++ b/service/history/timerQueueStandbyTaskExecutor_test.go @@ -1545,6 +1545,5 @@ func (s *timerQueueStandbyTaskExecutorSuite) newTaskExecutable( nil, nil, metrics.NoopMetricsHandler, - nil, ) } diff --git a/service/history/transferQueueActiveTaskExecutor_test.go b/service/history/transferQueueActiveTaskExecutor_test.go index 8a7a63399fd..be7cad7c126 100644 --- a/service/history/transferQueueActiveTaskExecutor_test.go +++ b/service/history/transferQueueActiveTaskExecutor_test.go @@ -2805,6 +2805,5 @@ func (s *transferQueueActiveTaskExecutorSuite) newTaskExecutable( nil, nil, metrics.NoopMetricsHandler, - nil, ) } diff --git a/service/history/transferQueueFactory.go b/service/history/transferQueueFactory.go index 58dc23d9731..c81203d46b7 100644 --- a/service/history/transferQueueFactory.go +++ b/service/history/transferQueueFactory.go @@ -179,7 +179,6 @@ func (f *transferQueueFactory) CreateQueue( CheckpointInterval: f.Config.TransferProcessorUpdateAckInterval, CheckpointIntervalJitterCoefficient: f.Config.TransferProcessorUpdateAckIntervalJitterCoefficient, MaxReaderCount: f.Config.QueueMaxReaderCount, - TaskMaxRetryCount: f.Config.TransferTaskMaxRetryCount, }, f.HostReaderRateLimiter, logger, diff --git a/service/history/transferQueueStandbyTaskExecutor_test.go b/service/history/transferQueueStandbyTaskExecutor_test.go index 5a74f468361..b1943b11606 100644 --- a/service/history/transferQueueStandbyTaskExecutor_test.go +++ b/service/history/transferQueueStandbyTaskExecutor_test.go @@ -1303,6 +1303,5 @@ func (s *transferQueueStandbyTaskExecutorSuite) newTaskExecutable( nil, nil, metrics.NoopMetricsHandler, - nil, ) } diff --git a/service/history/visibilityQueueFactory.go b/service/history/visibilityQueueFactory.go index 20488b5a207..9d49740eeeb 100644 --- a/service/history/visibilityQueueFactory.go +++ b/service/history/visibilityQueueFactory.go @@ -134,7 +134,6 @@ func (f *visibilityQueueFactory) CreateQueue( CheckpointInterval: f.Config.VisibilityProcessorUpdateAckInterval, CheckpointIntervalJitterCoefficient: f.Config.VisibilityProcessorUpdateAckIntervalJitterCoefficient, MaxReaderCount: f.Config.QueueMaxReaderCount, - TaskMaxRetryCount: f.Config.VisibilityTaskMaxRetryCount, }, f.HostReaderRateLimiter, logger, diff --git a/service/history/visibilityQueueTaskExecutor_test.go b/service/history/visibilityQueueTaskExecutor_test.go index 9c00a8d689a..c38ed37b52d 100644 --- a/service/history/visibilityQueueTaskExecutor_test.go +++ b/service/history/visibilityQueueTaskExecutor_test.go @@ -641,6 +641,5 @@ func (s *visibilityQueueTaskExecutorSuite) newTaskExecutable( nil, nil, metrics.NoopMetricsHandler, - nil, ) } From 9f839573e4661bc9bb84a6e75eac8de4862a4269 Mon Sep 17 00:00:00 2001 From: Yichao Yang Date: Wed, 4 Jan 2023 12:18:46 -0800 Subject: [PATCH 2/2] pr comments --- service/history/queues/executable.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/history/queues/executable.go b/service/history/queues/executable.go index e96915a294e..f0826a0cae2 100644 --- a/service/history/queues/executable.go +++ b/service/history/queues/executable.go @@ -89,9 +89,9 @@ const ( // resourceExhaustedResubmitMaxAttempts is the same as resubmitMaxAttempts but only applies to resource // exhausted error resourceExhaustedResubmitMaxAttempts = 1 - // taskCriticalAttempts, if exceeded, task attempts metrics and critical processing error log will be emitted + // taskCriticalLogMetricAttempts, if exceeded, task attempts metrics and critical processing error log will be emitted // while task is retrying - taskCriticalAttempts = 30 + taskCriticalLogMetricAttempts = 30 ) type ( @@ -208,9 +208,9 @@ func (e *executableImpl) HandleErr(err error) (retErr error) { defer e.Unlock() e.attempt++ - if e.attempt > taskCriticalAttempts { + if e.attempt > taskCriticalLogMetricAttempts { e.taggedMetricsHandler.Histogram(metrics.TaskAttempt.GetMetricName(), metrics.TaskAttempt.GetMetricUnit()).Record(int64(e.attempt)) - e.logger.Error("Critical error processing task, retrying.", tag.Error(err), tag.OperationCritical) + e.logger.Error("Critical error processing task, retrying.", tag.Attempt(int32(e.attempt)), tag.Error(err), tag.OperationCritical) } } }()