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: throw instead of silently overwriting timers #8785

Merged
3 commits merged into from
Feb 22, 2022
Merged

Conversation

lenaschoenburg
Copy link
Member

Description

Here we throw an exception when a timerId was generated that alreadyexists in the timerJobMap.
Throwing here will fail when scheduling a new timer or when resubmitting a recurring timer.

This should never happen, but we have one heapdump where it looks like it did: #8776

Related issues

relates to #8776

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.

Here we throw an exception when a timerId was generated that already
exists in the timerJobMap.
Throwing here will fail when scheduling a new timer or when resubmitting
a recurring timer.
This should never happen, but we have one heapdump where it looks like
it did: #8776
@lenaschoenburg lenaschoenburg marked this pull request as ready for review February 14, 2022 16:54
@lenaschoenburg
Copy link
Member Author

I think we should catch this exception in case re-submitting a recurring timer fails so that we don't kill an actor thread when this happens

Copy link
Member

@romansmirnov romansmirnov left a comment

Choose a reason for hiding this comment

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

I think we should catch this exception in case re-submitting a recurring timer fails so that we don't kill an actor thread when this happens

But I think we already have implemented a failure handling? Basically, the IllegalStateException is thrown which will be caught in ActorJob#execute() which may cause to fail the actor but to my understanding, the actor thread will keep running?

So, to me, the question would be if it is okay that the respective actor fails and what would be the impact of it?

What do you think?

Copy link
Member

@romansmirnov romansmirnov left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@lenaschoenburg
Copy link
Member Author

bors r+

ghost pushed a commit that referenced this pull request Feb 22, 2022
8785: fix: throw instead of silently overwriting timers r=oleschoenburg a=oleschoenburg

## Description

Here we throw an exception when a timerId was generated that alreadyexists in the timerJobMap.
Throwing here will fail when scheduling a new timer or when resubmitting a recurring timer.

This should never happen, but we have one heapdump where it looks like it did: #8776

## Related issues

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

relates to #8776



Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@ghost
Copy link

ghost commented Feb 22, 2022

Build failed:

@lenaschoenburg
Copy link
Member Author

bors retry

ghost pushed a commit that referenced this pull request Feb 22, 2022
8785: fix: throw instead of silently overwriting timers r=oleschoenburg a=oleschoenburg

## Description

Here we throw an exception when a timerId was generated that alreadyexists in the timerJobMap.
Throwing here will fail when scheduling a new timer or when resubmitting a recurring timer.

This should never happen, but we have one heapdump where it looks like it did: #8776

## Related issues

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

relates to #8776



Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@ghost
Copy link

ghost commented Feb 22, 2022

Build failed:

@lenaschoenburg
Copy link
Member Author

bors retry

ghost pushed a commit that referenced this pull request Feb 22, 2022
8785: fix: throw instead of silently overwriting timers r=oleschoenburg a=oleschoenburg

## Description

Here we throw an exception when a timerId was generated that alreadyexists in the timerJobMap.
Throwing here will fail when scheduling a new timer or when resubmitting a recurring timer.

This should never happen, but we have one heapdump where it looks like it did: #8776

## Related issues

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

relates to #8776



Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@ghost
Copy link

ghost commented Feb 22, 2022

Build failed:

@lenaschoenburg
Copy link
Member Author

bors retry

@ghost ghost merged commit de5a4e6 into main Feb 22, 2022
@ghost ghost deleted the throw-on-conflicting-timers branch February 22, 2022 12:40
@github-actions
Copy link
Contributor

Successfully created backport PR #8826 for stable/1.2.

@github-actions
Copy link
Contributor

Successfully created backport PR #8827 for stable/1.3.

ghost pushed a commit that referenced this pull request Feb 22, 2022
8827: [Backport stable/1.3] fix: throw instead of silently overwriting timers r=oleschoenburg a=github-actions[bot]

# Description
Backport of #8785 to `stable/1.3`.

relates to #8776 #8776

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
ghost pushed a commit that referenced this pull request Feb 22, 2022
8826: [Backport stable/1.2] fix: throw instead of silently overwriting timers r=oleschoenburg a=github-actions[bot]

# Description
Backport of #8785 to `stable/1.2`.

relates to #8776 #8776

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@Zelldon Zelldon added Release: 1.2.11 version:1.3.5 Marks an issue as being completely or in parts released in 1.3.5 labels Mar 1, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:1.3.5 Marks an issue as being completely or in parts released in 1.3.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants