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

Reduce FORK/JOIN latency #352

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Reduce FORK/JOIN latency #352

merged 3 commits into from
Jan 7, 2025

Conversation

jmigueprieto
Copy link
Contributor

@jmigueprieto jmigueprieto commented Jan 4, 2025

Pull Request type

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

Changes in this PR

Currently, a JOIN execution is delayed exponentially up to a maximum of 30s in the default configuration. This may cause a JOIN to complete with a significant delay compared to the actual completion of all forked tasks.

These changes introduce a configurable postpone calculation (with a less aggressive increase) and a configurable Queue Pop Timeout. By tweaking those values we can reduce the JOIN latency at the start and the end.

SEE also: orkes-io/orkes-queues#19

@jmigueprieto jmigueprieto self-assigned this Jan 4, 2025
@jmigueprieto jmigueprieto force-pushed the fix/join-latency-issues branch from 8c75eda to bf90790 Compare January 6, 2025 22:43
int index = taskModel.getPollCount() > 0 ? taskModel.getPollCount() - 1 : 0;
if (index == 0) {
public Optional<Long> getEvaluationOffset(TaskModel taskModel, long maxOffset) {
int pollCount = taskModel.getPollCount();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reduce the delay of the JOIN task when all forked tasks complete it will not be postponed until pollCount is above a given configurable threshold.

Once pollCount is greater than that threshold, the delay will increase until reaching maxOffset.

@jmigueprieto jmigueprieto changed the title (WIP) Reduce FORK/JOIN latency Reduce FORK/JOIN latency Jan 6, 2025
@jmigueprieto jmigueprieto marked this pull request as ready for review January 6, 2025 23:03
@v1r3n v1r3n merged commit 8a6c3f7 into main Jan 7, 2025
8 checks passed
@v1r3n v1r3n deleted the fix/join-latency-issues branch January 7, 2025 19:38
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