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

Adding total timeout to task #313

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

shaileshpadave
Copy link

@shaileshpadave shaileshpadave commented Nov 19, 2024

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • WHOSUSING.md
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR

Added new parameter total task timeout to taskmodel and task def. This will be useful to timeout task if it exceeds total timeout value (including timeout in retry as well), this PR is only for model changes. Core service changes will be in another PR.

Describe the new behavior from this PR, and why it's needed
Issue #

Alternatives considered

Describe alternative implementation you have considered

@shaileshpadave shaileshpadave force-pushed the addTotalTimeout branch 3 times, most recently from 5be9986 to 95851be Compare November 19, 2024 14:50
@@ -202,6 +202,9 @@ public boolean isRetriable() {
@ProtoField(id = 42)
private boolean subworkflowChanged;

@ProtoField(id = 43)
private long firstStartTime;
Copy link
Contributor

Choose a reason for hiding this comment

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

should be added to equals, hashcode and toString?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, I think we should change the hashCode to be aware of the task's PK -- which is taskName. Thoughts @jmigueprieto

/**
* @return the total timeout in seconds
*/
public long getTotalTimeoutSeconds() {
Copy link
Contributor

Choose a reason for hiding this comment

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

equals & hashCode?

@@ -142,11 +146,17 @@ public TaskDef(String name, String description) {
this.description = description;
}

public TaskDef(String name, String description, int retryCount, long timeoutSeconds) {
public TaskDef(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can a new constructor be added instead of changing the signature of this one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@jmigueprieto jmigueprieto left a comment

Choose a reason for hiding this comment

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

  • There are changes to backend and client v4 - split this PR.
  • The client changes are breaking changes. Do NOT modify the signature of existing constructors. They might be in use by someone and adding a property should NOT break existing code.

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.

3 participants