From 986e519ccd629ee6bd506ed1e3b4804f9922b013 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Fri, 10 Jan 2025 14:39:57 -0800 Subject: [PATCH 01/10] Set auto config hint for empty polls --- service/matching/handler/engine.go | 8 ++++++++ service/matching/tasklist/interfaces.go | 1 + service/matching/tasklist/interfaces_mock.go | 14 ++++++++++++++ service/matching/tasklist/task_list_manager.go | 5 +++++ 4 files changed, 28 insertions(+) diff --git a/service/matching/handler/engine.go b/service/matching/handler/engine.go index 0dbc6077be5..0844c862837 100644 --- a/service/matching/handler/engine.go +++ b/service/matching/handler/engine.go @@ -539,6 +539,10 @@ pollLoop: if err != nil { return nil, fmt.Errorf("couldn't load tasklist namanger: %w", err) } + pollerWaitTimeMs := int64(0) + if deadline, ok := pollerCtx.Deadline(); ok { + pollerWaitTimeMs = int64(time.Until(deadline).Milliseconds()) + } task, err := tlMgr.GetTask(pollerCtx, nil) if err != nil { // TODO: Is empty poll the best reply for errPumpClosed? @@ -564,6 +568,10 @@ pollLoop: return &types.MatchingPollForDecisionTaskResponse{ PartitionConfig: tlMgr.TaskListPartitionConfig(), LoadBalancerHints: tlMgr.LoadBalancerHints(), + AutoConfigHint: &types.AutoConfigHint{ + EnableAutoConfig: tlMgr.EnableClientAutoConfig(), + PollerWaitTimeInMs: pollerWaitTimeMs, + }, }, nil } return nil, fmt.Errorf("couldn't get task: %w", err) diff --git a/service/matching/tasklist/interfaces.go b/service/matching/tasklist/interfaces.go index c1d14e10543..92be8531912 100644 --- a/service/matching/tasklist/interfaces.go +++ b/service/matching/tasklist/interfaces.go @@ -64,6 +64,7 @@ type ( UpdateTaskListPartitionConfig(context.Context, *types.TaskListPartitionConfig) error RefreshTaskListPartitionConfig(context.Context, *types.TaskListPartitionConfig) error LoadBalancerHints() *types.LoadBalancerHints + EnableClientAutoConfig() bool } TaskMatcher interface { diff --git a/service/matching/tasklist/interfaces_mock.go b/service/matching/tasklist/interfaces_mock.go index 7d571bf7b84..d5063354bcc 100644 --- a/service/matching/tasklist/interfaces_mock.go +++ b/service/matching/tasklist/interfaces_mock.go @@ -135,6 +135,20 @@ func (mr *MockManagerMockRecorder) DispatchTask(ctx, task any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DispatchTask", reflect.TypeOf((*MockManager)(nil).DispatchTask), ctx, task) } +// EnableClientAutoConfig mocks base method. +func (m *MockManager) EnableClientAutoConfig() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnableClientAutoConfig") + ret0, _ := ret[0].(bool) + return ret0 +} + +// EnableClientAutoConfig indicates an expected call of EnableClientAutoConfig. +func (mr *MockManagerMockRecorder) EnableClientAutoConfig() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableClientAutoConfig", reflect.TypeOf((*MockManager)(nil).EnableClientAutoConfig)) +} + // GetAllPollerInfo mocks base method. func (m *MockManager) GetAllPollerInfo() []*types.PollerInfo { m.ctrl.T.Helper() diff --git a/service/matching/tasklist/task_list_manager.go b/service/matching/tasklist/task_list_manager.go index 0dd5a5aa756..20a781ba2b8 100644 --- a/service/matching/tasklist/task_list_manager.go +++ b/service/matching/tasklist/task_list_manager.go @@ -971,6 +971,11 @@ func (c *taskListManagerImpl) emitMisconfiguredPartitionMetrics() { } } +// EnableClientAutoConfig checks if there client auto config is enabled for tasklist +func (c *taskListManagerImpl) EnableClientAutoConfig() bool { + return c.config.EnableClientAutoConfig() +} + func getTaskListTypeTag(taskListType int) metrics.Tag { switch taskListType { case persistence.TaskListTypeActivity: From fcdeefc5f20d137563e02af6e711c2f3e3f57b47 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Fri, 10 Jan 2025 15:18:21 -0800 Subject: [PATCH 02/10] Set auto config hint for activity task empty polls --- service/matching/handler/engine.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/service/matching/handler/engine.go b/service/matching/handler/engine.go index 0844c862837..2e5c3c24790 100644 --- a/service/matching/handler/engine.go +++ b/service/matching/handler/engine.go @@ -730,6 +730,10 @@ pollLoop: if err != nil { return nil, fmt.Errorf("couldn't load tasklist namanger: %w", err) } + pollerWaitTimeMs := int64(0) + if deadline, ok := pollerCtx.Deadline(); ok { + pollerWaitTimeMs = int64(time.Until(deadline).Milliseconds()) + } task, err := tlMgr.GetTask(pollerCtx, maxDispatch) if err != nil { // TODO: Is empty poll the best reply for errPumpClosed? @@ -737,6 +741,10 @@ pollLoop: return &types.MatchingPollForActivityTaskResponse{ PartitionConfig: tlMgr.TaskListPartitionConfig(), LoadBalancerHints: tlMgr.LoadBalancerHints(), + AutoConfigHint: &types.AutoConfigHint{ + EnableAutoConfig: tlMgr.EnableClientAutoConfig(), + PollerWaitTimeInMs: pollerWaitTimeMs, + }, }, nil } e.logger.Error("Received unexpected err while getting task", From ac181bc30c947377018078a6434afab321666dc9 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Fri, 10 Jan 2025 15:46:57 -0800 Subject: [PATCH 03/10] fix test --- service/matching/handler/engine_integration_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/service/matching/handler/engine_integration_test.go b/service/matching/handler/engine_integration_test.go index 45b10d8f941..be7f0a67093 100644 --- a/service/matching/handler/engine_integration_test.go +++ b/service/matching/handler/engine_integration_test.go @@ -1134,7 +1134,12 @@ func (s *matchingEngineSuite) UnloadTasklistOnIsolationConfigChange(taskType int } result, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) - s.Equal(&pollTaskResponse{}, result) + s.Equal(&pollTaskResponse{ + AutoConfigHint: &types.AutoConfigHint{ + EnableAutoConfig: false, + PollerWaitTimeInMs: 0, + }, + }, result) // empty polls returns auto config hint result, err = pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) From 46fd4c3ec30aee6ba946ac59672d89a87df9a518 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Mon, 13 Jan 2025 13:12:59 -0800 Subject: [PATCH 04/10] Use timer instead of getting deadline from context --- service/matching/handler/engine.go | 14 ++++--------- .../handler/engine_integration_test.go | 21 ++++++++++++++++--- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/service/matching/handler/engine.go b/service/matching/handler/engine.go index 2e5c3c24790..7c86d32a663 100644 --- a/service/matching/handler/engine.go +++ b/service/matching/handler/engine.go @@ -539,10 +539,7 @@ pollLoop: if err != nil { return nil, fmt.Errorf("couldn't load tasklist namanger: %w", err) } - pollerWaitTimeMs := int64(0) - if deadline, ok := pollerCtx.Deadline(); ok { - pollerWaitTimeMs = int64(time.Until(deadline).Milliseconds()) - } + startT := time.Now() // Record the start time task, err := tlMgr.GetTask(pollerCtx, nil) if err != nil { // TODO: Is empty poll the best reply for errPumpClosed? @@ -570,7 +567,7 @@ pollLoop: LoadBalancerHints: tlMgr.LoadBalancerHints(), AutoConfigHint: &types.AutoConfigHint{ EnableAutoConfig: tlMgr.EnableClientAutoConfig(), - PollerWaitTimeInMs: pollerWaitTimeMs, + PollerWaitTimeInMs: time.Since(startT).Milliseconds(), }, }, nil } @@ -730,10 +727,7 @@ pollLoop: if err != nil { return nil, fmt.Errorf("couldn't load tasklist namanger: %w", err) } - pollerWaitTimeMs := int64(0) - if deadline, ok := pollerCtx.Deadline(); ok { - pollerWaitTimeMs = int64(time.Until(deadline).Milliseconds()) - } + startT := time.Now() // Record the start time task, err := tlMgr.GetTask(pollerCtx, maxDispatch) if err != nil { // TODO: Is empty poll the best reply for errPumpClosed? @@ -743,7 +737,7 @@ pollLoop: LoadBalancerHints: tlMgr.LoadBalancerHints(), AutoConfigHint: &types.AutoConfigHint{ EnableAutoConfig: tlMgr.EnableClientAutoConfig(), - PollerWaitTimeInMs: pollerWaitTimeMs, + PollerWaitTimeInMs: time.Since(startT).Milliseconds(), }, }, nil } diff --git a/service/matching/handler/engine_integration_test.go b/service/matching/handler/engine_integration_test.go index be7f0a67093..c2f95eaabfd 100644 --- a/service/matching/handler/engine_integration_test.go +++ b/service/matching/handler/engine_integration_test.go @@ -311,7 +311,12 @@ func (s *matchingEngineSuite) PollForDecisionTasksResultTest() { } resp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) - s.Equal(&pollTaskResponse{}, resp) + s.Equal(&pollTaskResponse{ + AutoConfigHint: &types.AutoConfigHint{ + EnableAutoConfig: false, + PollerWaitTimeInMs: 0, + }, + }, resp) // add task to sticky tasklist again, this time it should pass _, err = addTask(s.matchingEngine, s.handlerContext, addRequest) s.NoError(err) @@ -364,7 +369,12 @@ func (s *matchingEngineSuite) PollForTasksEmptyResultTest(callContext context.Co } pollResp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) - s.Equal(&pollTaskResponse{}, pollResp) + s.Equal(&pollTaskResponse{ + AutoConfigHint: &types.AutoConfigHint{ + EnableAutoConfig: false, + PollerWaitTimeInMs: 0, + }, + }, pollResp) if taskType == persistence.TaskListTypeActivity { taskListType = types.TaskListTypeActivity @@ -952,7 +962,12 @@ func (s *matchingEngineSuite) PollWithExpiredContext(taskType int) { s.handlerContext.Context = ctx resp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.Nil(err) - s.Equal(&pollTaskResponse{}, resp) + s.Equal(&pollTaskResponse{ + AutoConfigHint: &types.AutoConfigHint{ + EnableAutoConfig: false, + PollerWaitTimeInMs: 0, + }, + }, resp) } func (s *matchingEngineSuite) TestMultipleEnginesActivitiesRangeStealing() { From 793b164079721c6c5cd4f4aa2c1a25be348d4b2e Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Mon, 13 Jan 2025 14:48:12 -0800 Subject: [PATCH 05/10] Fix test --- .../handler/engine_integration_test.go | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/service/matching/handler/engine_integration_test.go b/service/matching/handler/engine_integration_test.go index c2f95eaabfd..c570e4dbb94 100644 --- a/service/matching/handler/engine_integration_test.go +++ b/service/matching/handler/engine_integration_test.go @@ -311,12 +311,8 @@ func (s *matchingEngineSuite) PollForDecisionTasksResultTest() { } resp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) - s.Equal(&pollTaskResponse{ - AutoConfigHint: &types.AutoConfigHint{ - EnableAutoConfig: false, - PollerWaitTimeInMs: 0, - }, - }, resp) + resp.AutoConfigHint = nil + s.Equal(&pollTaskResponse{}, resp) // add task to sticky tasklist again, this time it should pass _, err = addTask(s.matchingEngine, s.handlerContext, addRequest) s.NoError(err) @@ -368,13 +364,9 @@ func (s *matchingEngineSuite) PollForTasksEmptyResultTest(callContext context.Co Identity: identity, } pollResp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) + pollResp.AutoConfigHint = nil // poller wait time is not a fixed value, exclude it from comparison s.NoError(err) - s.Equal(&pollTaskResponse{ - AutoConfigHint: &types.AutoConfigHint{ - EnableAutoConfig: false, - PollerWaitTimeInMs: 0, - }, - }, pollResp) + s.Equal(&pollTaskResponse{}, pollResp) if taskType == persistence.TaskListTypeActivity { taskListType = types.TaskListTypeActivity @@ -962,12 +954,7 @@ func (s *matchingEngineSuite) PollWithExpiredContext(taskType int) { s.handlerContext.Context = ctx resp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.Nil(err) - s.Equal(&pollTaskResponse{ - AutoConfigHint: &types.AutoConfigHint{ - EnableAutoConfig: false, - PollerWaitTimeInMs: 0, - }, - }, resp) + s.Equal(&pollTaskResponse{}, resp) } func (s *matchingEngineSuite) TestMultipleEnginesActivitiesRangeStealing() { @@ -1149,12 +1136,8 @@ func (s *matchingEngineSuite) UnloadTasklistOnIsolationConfigChange(taskType int } result, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) - s.Equal(&pollTaskResponse{ - AutoConfigHint: &types.AutoConfigHint{ - EnableAutoConfig: false, - PollerWaitTimeInMs: 0, - }, - }, result) // empty polls returns auto config hint + result.AutoConfigHint = nil + s.Equal(&pollTaskResponse{}, result) result, err = pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) From 262da845ca3127a8f090895301ea2d6d729cafb5 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Mon, 13 Jan 2025 16:08:36 -0800 Subject: [PATCH 06/10] Another try --- service/matching/handler/engine_integration_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/service/matching/handler/engine_integration_test.go b/service/matching/handler/engine_integration_test.go index c570e4dbb94..668e55196be 100644 --- a/service/matching/handler/engine_integration_test.go +++ b/service/matching/handler/engine_integration_test.go @@ -954,6 +954,7 @@ func (s *matchingEngineSuite) PollWithExpiredContext(taskType int) { s.handlerContext.Context = ctx resp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.Nil(err) + resp.AutoConfigHint = nil s.Equal(&pollTaskResponse{}, resp) } From 6202c87bd18b59031f6f5b4cb8881ea085af07e5 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Tue, 14 Jan 2025 12:26:02 -0800 Subject: [PATCH 07/10] Get auto config hint from matching engine config, remove interface change --- service/matching/handler/engine.go | 6 ++++-- .../matching/handler/engine_integration_test.go | 5 +++++ service/matching/tasklist/interfaces.go | 1 - service/matching/tasklist/interfaces_mock.go | 14 -------------- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/service/matching/handler/engine.go b/service/matching/handler/engine.go index 7c86d32a663..c8dfc7da59b 100644 --- a/service/matching/handler/engine.go +++ b/service/matching/handler/engine.go @@ -562,11 +562,12 @@ pollLoop: "RequestForwardedFrom": req.GetForwardedFrom(), }, }) + domainName, _ := e.domainCache.GetDomainName(domainID) return &types.MatchingPollForDecisionTaskResponse{ PartitionConfig: tlMgr.TaskListPartitionConfig(), LoadBalancerHints: tlMgr.LoadBalancerHints(), AutoConfigHint: &types.AutoConfigHint{ - EnableAutoConfig: tlMgr.EnableClientAutoConfig(), + EnableAutoConfig: e.config.EnableClientAutoConfig(domainName, taskListName, persistence.TaskListTypeDecision), PollerWaitTimeInMs: time.Since(startT).Milliseconds(), }, }, nil @@ -732,11 +733,12 @@ pollLoop: if err != nil { // TODO: Is empty poll the best reply for errPumpClosed? if errors.Is(err, tasklist.ErrNoTasks) || errors.Is(err, errPumpClosed) { + domainName, _ := e.domainCache.GetDomainName(domainID) return &types.MatchingPollForActivityTaskResponse{ PartitionConfig: tlMgr.TaskListPartitionConfig(), LoadBalancerHints: tlMgr.LoadBalancerHints(), AutoConfigHint: &types.AutoConfigHint{ - EnableAutoConfig: tlMgr.EnableClientAutoConfig(), + EnableAutoConfig: e.config.EnableClientAutoConfig(domainName, taskListName, persistence.TaskListTypeDecision), PollerWaitTimeInMs: time.Since(startT).Milliseconds(), }, }, nil diff --git a/service/matching/handler/engine_integration_test.go b/service/matching/handler/engine_integration_test.go index 668e55196be..7ee3dc5f2f3 100644 --- a/service/matching/handler/engine_integration_test.go +++ b/service/matching/handler/engine_integration_test.go @@ -311,6 +311,7 @@ func (s *matchingEngineSuite) PollForDecisionTasksResultTest() { } resp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) + s.NotNil(resp.AutoConfigHint) resp.AutoConfigHint = nil s.Equal(&pollTaskResponse{}, resp) // add task to sticky tasklist again, this time it should pass @@ -364,6 +365,7 @@ func (s *matchingEngineSuite) PollForTasksEmptyResultTest(callContext context.Co Identity: identity, } pollResp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) + s.NotNil(pollResp.AutoConfigHint) pollResp.AutoConfigHint = nil // poller wait time is not a fixed value, exclude it from comparison s.NoError(err) s.Equal(&pollTaskResponse{}, pollResp) @@ -954,6 +956,7 @@ func (s *matchingEngineSuite) PollWithExpiredContext(taskType int) { s.handlerContext.Context = ctx resp, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.Nil(err) + s.NotNil(resp.AutoConfigHint) resp.AutoConfigHint = nil s.Equal(&pollTaskResponse{}, resp) } @@ -1137,6 +1140,7 @@ func (s *matchingEngineSuite) UnloadTasklistOnIsolationConfigChange(taskType int } result, err := pollTask(s.matchingEngine, s.handlerContext, pollReq) s.NoError(err) + s.NotNil(result.AutoConfigHint) result.AutoConfigHint = nil s.Equal(&pollTaskResponse{}, result) @@ -1648,6 +1652,7 @@ func pollTask(engine *matchingEngineImpl, hCtx *handlerContext, request *pollTas WorkflowType: resp.WorkflowType, WorkflowDomain: resp.WorkflowDomain, Header: resp.Header, + AutoConfigHint: resp.AutoConfigHint, }, nil } resp, err := engine.PollForDecisionTask(hCtx, &types.MatchingPollForDecisionTaskRequest{ diff --git a/service/matching/tasklist/interfaces.go b/service/matching/tasklist/interfaces.go index 92be8531912..c1d14e10543 100644 --- a/service/matching/tasklist/interfaces.go +++ b/service/matching/tasklist/interfaces.go @@ -64,7 +64,6 @@ type ( UpdateTaskListPartitionConfig(context.Context, *types.TaskListPartitionConfig) error RefreshTaskListPartitionConfig(context.Context, *types.TaskListPartitionConfig) error LoadBalancerHints() *types.LoadBalancerHints - EnableClientAutoConfig() bool } TaskMatcher interface { diff --git a/service/matching/tasklist/interfaces_mock.go b/service/matching/tasklist/interfaces_mock.go index d5063354bcc..7d571bf7b84 100644 --- a/service/matching/tasklist/interfaces_mock.go +++ b/service/matching/tasklist/interfaces_mock.go @@ -135,20 +135,6 @@ func (mr *MockManagerMockRecorder) DispatchTask(ctx, task any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DispatchTask", reflect.TypeOf((*MockManager)(nil).DispatchTask), ctx, task) } -// EnableClientAutoConfig mocks base method. -func (m *MockManager) EnableClientAutoConfig() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EnableClientAutoConfig") - ret0, _ := ret[0].(bool) - return ret0 -} - -// EnableClientAutoConfig indicates an expected call of EnableClientAutoConfig. -func (mr *MockManagerMockRecorder) EnableClientAutoConfig() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableClientAutoConfig", reflect.TypeOf((*MockManager)(nil).EnableClientAutoConfig)) -} - // GetAllPollerInfo mocks base method. func (m *MockManager) GetAllPollerInfo() []*types.PollerInfo { m.ctrl.T.Helper() From 3cbe3194bb0365bca179b7008e685044e8d262c9 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Tue, 14 Jan 2025 12:28:40 -0800 Subject: [PATCH 08/10] clean up --- service/matching/handler/engine.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/service/matching/handler/engine.go b/service/matching/handler/engine.go index c8dfc7da59b..6c249a75c9f 100644 --- a/service/matching/handler/engine.go +++ b/service/matching/handler/engine.go @@ -539,7 +539,6 @@ pollLoop: if err != nil { return nil, fmt.Errorf("couldn't load tasklist namanger: %w", err) } - startT := time.Now() // Record the start time task, err := tlMgr.GetTask(pollerCtx, nil) if err != nil { // TODO: Is empty poll the best reply for errPumpClosed? @@ -728,7 +727,6 @@ pollLoop: if err != nil { return nil, fmt.Errorf("couldn't load tasklist namanger: %w", err) } - startT := time.Now() // Record the start time task, err := tlMgr.GetTask(pollerCtx, maxDispatch) if err != nil { // TODO: Is empty poll the best reply for errPumpClosed? From 91d4b09b6e642da69e38a877be85978282af7f5e Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Tue, 14 Jan 2025 12:30:20 -0800 Subject: [PATCH 09/10] one more clean up --- service/matching/tasklist/task_list_manager.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/service/matching/tasklist/task_list_manager.go b/service/matching/tasklist/task_list_manager.go index 20a781ba2b8..0dd5a5aa756 100644 --- a/service/matching/tasklist/task_list_manager.go +++ b/service/matching/tasklist/task_list_manager.go @@ -971,11 +971,6 @@ func (c *taskListManagerImpl) emitMisconfiguredPartitionMetrics() { } } -// EnableClientAutoConfig checks if there client auto config is enabled for tasklist -func (c *taskListManagerImpl) EnableClientAutoConfig() bool { - return c.config.EnableClientAutoConfig() -} - func getTaskListTypeTag(taskListType int) metrics.Tag { switch taskListType { case persistence.TaskListTypeActivity: From df076f6fd9e70d907d2740d15713f6610df84919 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Tue, 14 Jan 2025 12:38:58 -0800 Subject: [PATCH 10/10] Deleted extra code by accident --- service/matching/handler/engine.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/matching/handler/engine.go b/service/matching/handler/engine.go index 6c249a75c9f..c8dfc7da59b 100644 --- a/service/matching/handler/engine.go +++ b/service/matching/handler/engine.go @@ -539,6 +539,7 @@ pollLoop: if err != nil { return nil, fmt.Errorf("couldn't load tasklist namanger: %w", err) } + startT := time.Now() // Record the start time task, err := tlMgr.GetTask(pollerCtx, nil) if err != nil { // TODO: Is empty poll the best reply for errPumpClosed? @@ -727,6 +728,7 @@ pollLoop: if err != nil { return nil, fmt.Errorf("couldn't load tasklist namanger: %w", err) } + startT := time.Now() // Record the start time task, err := tlMgr.GetTask(pollerCtx, maxDispatch) if err != nil { // TODO: Is empty poll the best reply for errPumpClosed?