Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add activity timeout context #6156

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions common/log/tag/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"fmt"
"time"

"github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common/types"
)

Expand Down Expand Up @@ -93,6 +94,11 @@ func WorkflowTimeoutType(timeoutType int64) Tag {
return newInt64("wf-timeout-type", timeoutType)
}

// ActivityTimeoutType returns tag for ActivityTimeoutType
func ActivityTimeoutType(timerType shared.TimeoutType) Tag {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can cast timer type to string and pass here to avoid depending on shared package in log package. I guess it's ok to depend on it here because all callers of log package is probably already importing shared.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered it more type-safe, so people pass the expected data, not just a string (though the data is actually a string)

return newStringTag("activity-timer-type", timerType.String())
}

// WorkflowPollContextTimeout returns tag for WorkflowPollContextTimeout
func WorkflowPollContextTimeout(pollContextTimeout time.Duration) Tag {
return newDurationTag("wf-poll-context-timeout", pollContextTimeout)
Expand Down
2 changes: 2 additions & 0 deletions service/history/task/timer_active_task_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"fmt"
"time"

"github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/backoff"
"github.com/uber/cadence/common/log"
Expand Down Expand Up @@ -430,6 +431,7 @@ Loop:
tag.WorkflowRunID(task.GetRunID()),
tag.ScheduleAttempt(task.ScheduleAttempt),
tag.FailoverVersion(task.GetVersion()),
tag.ActivityTimeoutType(shared.TimeoutType(timerSequenceID.TimerType)),
)

if _, err := mutableState.AddActivityTaskTimedOutEvent(
Expand Down
Loading