Skip to content

Conversation

@bergundy
Copy link
Member

@bergundy bergundy commented Jan 13, 2026

Overview

This commit implements two new granular timeout types for Nexus operations, allowing callers to have fine-grained control over different phases of operation execution:

  • Schedule-to-Start Timeout: Maximum time to wait for an operation to be started (or completed if synchronous) by the handler
  • Start-to-Close Timeout: Maximum time to wait for an asynchronous operation to complete after it has been started

These timeouts complement the existing Schedule-to-Close Timeout to provide better control and diagnostics for Nexus operation execution.

See the corresponding API PR: temporalio/api#695.

attrs.ScheduleToCloseTimeout = durationpb.New(maxTimeout)
}

// Trim secondary timeouts to the primary timeout.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also go the other way? If only schedule-to-start or start-to-close is set, but not schedule-to-close, should we set schedule-to-close to one of those timeouts?

IIRC the operation deadline we send to the handler is based only on schedule-to-close timeout, so the handler may not be aware that the operation has a deadline in that case.

Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't go the other way because the new timeouts are more specific. But you make a good point that the operation timeout header should take the new timeouts into consideration.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

bergundy added a commit to temporalio/api that referenced this pull request Jan 13, 2026
**What changed?**

Add ScheduleToStart and StartToClose timeouts for Nexus operations.

**Why?**

Give callers more control over timeouts of the various operation
lifecycle stages.

**Server PR**

temporalio/temporal#9010
temporal-cicd bot pushed a commit to temporalio/api-go that referenced this pull request Jan 13, 2026
**What changed?**

Add ScheduleToStart and StartToClose timeouts for Nexus operations.

**Why?**

Give callers more control over timeouts of the various operation
lifecycle stages.

**Server PR**

temporalio/temporal#9010
@bergundy bergundy requested a review from pdoerner January 13, 2026 17:57
@bergundy bergundy force-pushed the nexus-caller-timeouts branch from 1316c05 to a3b0e54 Compare January 13, 2026 18:53
@bergundy bergundy merged commit 8f4d4ba into temporalio:main Jan 13, 2026
66 checks passed
bergundy added a commit to bergundy/temporal that referenced this pull request Jan 15, 2026
bergundy added a commit that referenced this pull request Jan 15, 2026
This reverts commit 8f4d4ba.


## Why?

Noticed issues in nightly pipelines.
bergundy added a commit to bergundy/temporal that referenced this pull request Jan 15, 2026
bergundy added a commit that referenced this pull request Jan 16, 2026
## What changed?

Reapplied #9010.

The original PR that introduced these timeouts did not populate the
operation-timeout header or set the call context timeout correctly. This
PR fixes the logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants