-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix WAIT task is not working properly (after v3.13.0) #3639
Fix WAIT task is not working properly (after v3.13.0) #3639
Conversation
? taskModel.getWaitTimeout() + 1 | ||
: workflowOffsetTimeout; | ||
if (taskModel.getTaskType().equals(TaskType.TASK_TYPE_WAIT)) { | ||
long deltaInSeconds = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if the wait task has no timeout? This can happen if the WAIT is configured to wait for an external trigger without a timeout value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't take that case into account because it didn't seem to me that the Wait class allowed it, as it requires the use of duration or until. The only way to have a zero timeout is by setting the until parameter to the start of the epoch, January 1, 1970, at 0 hours.
However, I imagine it might be possible in another way that I'm not aware of.
Would you like me to share a code snippet that takes that case into account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to update the code. Should I create another Pull Request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also updated the branch in the same way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @yohanyflores , I see that when deltaInSeconds <= 0 shouldn't we mark the postponeDuration to 0 instead of 1 because there is no point in waiting for 1 more second?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manan164 Thanks for the change you suggest, you are right!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manan164 I updated the branch with the changes and tests.
…g-properly Fix WAIT task is not working properly (after v3.13.0)
Pull Request type
./gradlew generateLock saveLock
to refresh dependencies)NOTE: Please remember to run
./gradlew spotlessApply
to fix any format violations.Changes in this PR
Issue #3402
Alternatives considered