Skip to content

Commit

Permalink
Change noisy frontend poll timeout log to debug level (#5725)
Browse files Browse the repository at this point in the history
  • Loading branch information
taylanisikdemir authored Mar 5, 2024
1 parent 7de6d18 commit 768cb11
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ func ValidateLongPollContextTimeout(
return err
}
if timeout < CriticalLongPollTimeout {
logger.Warn("Context timeout is lower than critical value for long poll API.",
logger.Debug("Context timeout is lower than critical value for long poll API.",
tag.WorkflowHandlerName(handlerName), tag.WorkflowPollContextTimeout(timeout))
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion common/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ func TestValidateLongPollContextTimeout(t *testing.T) {
t.Run("context timeout is set, but less than CriticalLongPollTimeout", func(t *testing.T) {
logger := new(log.MockLogger)
logger.On(
"Warn",
"Debug",
"Context timeout is lower than critical value for long poll API.",
// we can't mock time between deadline and now, so we just check it as it is
mock.Anything,
Expand Down
8 changes: 4 additions & 4 deletions service/frontend/api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func (wh *WorkflowHandler) PollForActivityTask(
if err := common.ValidateLongPollContextTimeout(
ctx,
"PollForActivityTask",
wh.GetThrottledLogger(),
wh.GetThrottledLogger().WithTags(tag.WorkflowDomainName(domainName), tag.WorkflowTaskListName(pollRequest.GetTaskList().GetName())),
); err != nil {
return nil, err
}
Expand Down Expand Up @@ -478,7 +478,7 @@ func (wh *WorkflowHandler) PollForActivityTask(
if err := common.ValidateLongPollContextTimeout(
ctx,
"PollForActivityTask",
wh.GetThrottledLogger(),
wh.GetThrottledLogger().WithTags(tag.WorkflowDomainName(domainName), tag.WorkflowTaskListName(pollRequest.GetTaskList().GetName())),
); err != nil {
return &types.PollForActivityTaskResponse{}, nil
}
Expand Down Expand Up @@ -544,7 +544,7 @@ func (wh *WorkflowHandler) PollForDecisionTask(
if err := common.ValidateLongPollContextTimeout(
ctx,
"PollForDecisionTask",
wh.GetThrottledLogger(),
wh.GetThrottledLogger().WithTags(tag.WorkflowDomainName(domainName), tag.WorkflowTaskListName(pollRequest.GetTaskList().GetName())),
); err != nil {
return nil, err
}
Expand Down Expand Up @@ -598,7 +598,7 @@ func (wh *WorkflowHandler) PollForDecisionTask(
if err := common.ValidateLongPollContextTimeout(
ctx,
"PollForDecisionTask",
wh.GetThrottledLogger(),
wh.GetThrottledLogger().WithTags(tag.WorkflowDomainName(domainName), tag.WorkflowTaskListName(pollRequest.GetTaskList().GetName())),
); err != nil {
return &types.PollForDecisionTaskResponse{}, nil
}
Expand Down

0 comments on commit 768cb11

Please sign in to comment.