Skip to content

Have implicit activity context timeout start-to-close be relative to system time not server time #1930

Open
@cretz

Description

@cretz

Describe the solution you'd like

Currently the code at

sdk-go/internal/activity.go

Lines 444 to 454 in a921890

func calculateActivityDeadline(scheduled, started time.Time, scheduleToCloseTimeout, startToCloseTimeout time.Duration) time.Time {
startToCloseDeadline := started.Add(startToCloseTimeout)
if scheduleToCloseTimeout > 0 {
scheduleToCloseDeadline := scheduled.Add(scheduleToCloseTimeout)
// Minimum of the two deadlines.
if scheduleToCloseDeadline.Before(startToCloseDeadline) {
return scheduleToCloseDeadline
}
}
return startToCloseDeadline
}
has start-to-close calculated from server-provided start time instead of current system time which means it may be subject to skew (ref #1912). Have it based on time.Now() instead. Note, nothing can be done about schedule-to-start equivalent because there is no local-time equivalent for "scheduled".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions