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

Fix timer scheduling #10534

Merged
merged 2 commits into from
Sep 28, 2022
Merged

Fix timer scheduling #10534

merged 2 commits into from
Sep 28, 2022

Conversation

Zelldon
Copy link
Member

@Zelldon Zelldon commented Sep 28, 2022

Description

If we already scheduled a Task for a created Timer, we shouldn't schedule another Task on next timer creation. This PR fixes that.

The previous behavior could cause severe issues, like exponential increasing backlog if a lot of timers are created per second etc. see #10532 and #10526

Related issues

closes #10532

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

If we already scheduled a Task for a created Timer, we shouldn't
schedule another Task on next timer creation. This commit fixes that.
The previous behavior could severe issues, like exponential increasing
backlog if a lot of timers are created per second etc.
@Zelldon Zelldon requested a review from saig0 September 28, 2022 10:27
@Zelldon
Copy link
Member Author

Zelldon commented Sep 28, 2022

I have run some benchmarks to compare the fix. I was not able yet to run the E2E tests, but I will do with a next release candidate.

Benchmarks

Benchmarks only timers (rate 100 PI/s)

Timer Benchmark with bug

timer-bug

Timer Benchmark with fix

timer-fix

We can see that it is much more stable in the processing and fewer events are skipped. The backpressure is reduced by half.

Mixed Benchmark with bug

For that I used the medic cw 39 (and checked the begin of the benchmark). The begin of the mixed looks always okayisch later it shows higher backpressure. But we can see in the begin already issues with the latencies.

mixed-bug
mixed-latency-bug

Mixed Benchmark with fix

In the fixed mixed benchmark we see in general processing not much difference, but in the latency which looks much stable. I will run this benchmark for a while. After ca 5 hours the mixed often failed, so lets see. But I think we can already merge it.

mixed-fix
mixed-latency-fix

@github-actions
Copy link
Contributor

Test Results

   933 files  +  1     933 suites  +1   2h 13m 24s ⏱️ + 8m 25s
7 460 tests  - 30  7 450 ✔️  - 30  10 💤 ±0  0 ±0 
7 648 runs   - 30  7 638 ✔️  - 30  10 💤 ±0  0 ±0 

Results for commit e769bcd. ± Comparison against base commit 751ac05.

@Zelldon
Copy link
Member Author

Zelldon commented Sep 28, 2022

I retagged the docker image such that I can run the E2E tests and it looks great now

e2e

Previously:

e2e-before

Copy link
Member

@saig0 saig0 left a comment

Choose a reason for hiding this comment

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

@Zelldon looks good. 👍

@saig0
Copy link
Member

saig0 commented Sep 28, 2022

bors merge

zeebe-bors-camunda bot added a commit that referenced this pull request Sep 28, 2022
10534: Fix timer scheduling r=saig0 a=Zelldon

## Description

If we already scheduled a Task for a created Timer, we shouldn't schedule another Task on next timer creation. This PR fixes that.

The previous behavior could cause severe issues, like exponential increasing backlog if a lot of timers are created per second etc. see #10532 and #10526

<!-- Please explain the changes you made here. -->

## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #10532



Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@Zelldon
Copy link
Member Author

Zelldon commented Sep 28, 2022

bors r+

zeebe-bors-camunda bot added a commit that referenced this pull request Sep 28, 2022
10534: Fix timer scheduling r=Zelldon a=Zelldon

## Description

If we already scheduled a Task for a created Timer, we shouldn't schedule another Task on next timer creation. This PR fixes that.

The previous behavior could cause severe issues, like exponential increasing backlog if a lot of timers are created per second etc. see #10532 and #10526

<!-- Please explain the changes you made here. -->

## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #10532



Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@Zelldon
Copy link
Member Author

Zelldon commented Sep 28, 2022

bors r+

NOW

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit c0b3ffc into main Sep 28, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the zell-fix-timer-schedule branch September 28, 2022 12:53
@backport-action
Copy link
Collaborator

Successfully created backport PR #10535 for release-8.1.0.

zeebe-bors-camunda bot added a commit that referenced this pull request Sep 28, 2022
10535: [Backport release-8.1.0] Fix timer scheduling r=Zelldon a=backport-action

# Description
Backport of #10534 to `release-8.1.0`.

relates to #10532 #10526 #10532

Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
zeebe-bors-camunda bot added a commit that referenced this pull request Sep 28, 2022
10535: [Backport release-8.1.0] Fix timer scheduling r=Zelldon a=backport-action

# Description
Backport of #10534 to `release-8.1.0`.

relates to #10532 #10526 #10532

Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
@Zelldon Zelldon added the version:8.1.0 Marks an issue as being completely or in parts released in 8.1.0 label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:8.1.0 Marks an issue as being completely or in parts released in 8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timer creations will cause to schedule multiple Tasks
3 participants