Skip to content

Conversation

@davedwwang
Copy link
Contributor

Why are the changes needed?

Close #4040.

Brief change log

Update the default value of OPTIMIZER_TASK_EXECUTE_TIMEOUT from Duration.ofHours(1) to Duration.ofMillis(Long.MAX_VALUE) ns

How was this patch tested?

  • [ x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • [x ] Run test locally before making a pull request

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (docs)

@github-actions github-actions bot added type:docs Improvements or additions to documentation module:ams-server Ams server module module:common labels Jan 15, 2026
@davedwwang
Copy link
Contributor Author

hello @klion26 @Jzjsnow Please take a look.

Copy link
Member

@klion26 klion26 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, left some comments, please let me know what do you think about them.

.defaultValue(Duration.ofSeconds(30))
.withDescription("Timeout duration for task acknowledgment.");

// defaultValue must be in nanoseconds; otherwise, TimeUtils.formatWithHighestUnit will fail with
Copy link
Member

Choose a reason for hiding this comment

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

IIUC we use Duration.ofNanos(Long.MAX_VALUE) instead of Duration.ofHours(xx)(or others) because they will overflow, if this is true, maybe we don't need this comment, or we can move it to the L482

Copy link
Member

Choose a reason for hiding this comment

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

Could we use the TimeUnit::Second? (may be with Int.MAX_VALUE), Fom my perspective, seconds are used more often than nanoseconds.

}
}

private boolean isTaskExecTimeout(TaskRuntime<?> task) {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for extracting the common logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:ams-server Ams server module module:common type:docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement]: Change default value of optimizer.task-execute-timeout to Long.MAX_VALUE ns

2 participants