-
Notifications
You must be signed in to change notification settings - Fork 565
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(polling/state): prevent duplicates in repeatable requests list #8392
Conversation
I know, I know... using Possible Solutions:
|
db96d02
to
3cb1a15
Compare
Dear Reviewer, Please consider the following:
Also, the PR might be in conflict with the PR #8389 when merging it. |
// the last request does not activate any jobs | ||
final var fourthRequest = getLongPollingActivateJobsRequest(); | ||
|
||
final var allRequestsSubmittedLatch = new CountDownLatch(1); |
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.
Dear Reviewer, just FYI: I consciously decided to use the CountDownLatch
to ensure that all requests are submitted to the actor initially. As an alternative, I considered using the ControlledActorScheduler
but the test was too flaky with the controlled scheduler. With the latch, the test is reliable.
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 think introducing a request id is not necessary because we can just rely on identity to check for duplicates in activeRequestsToBeRepeated
. We create new instances of LongPollingActivateJobsRequest
only once.
That means activeRequestsToBeRepeated
could be:
private final Set<LongPollingActivateJobsRequest> activeRequestsToBeRepeated =
Collections.newSetFromMap(new IdentityHashMap<>());
Unless we want to use the request id for more than just checking duplicates I think we should not introduce it here and instead rely on object identity.
WDYT?
Regarding identity, what you say sounds reasonable - as long as we only create requests once and each instance is meant to be unique, it should be OK to simply use the default
That's just OTOH though - my proposal would be to accept with the ID, and open a follow up to discuss it with Roman when he's back - there's no rush here, and removing the ID or taking a different approach in the long run is easy to do. Let me know what you think 👍 |
3cb1a15
to
460fc6f
Compare
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 rebased to resolve conflicts with the other gateway/long-polling related PRs.
bors r+
Build succeeded: |
Successfully created backport PR #8453 for |
Successfully created backport PR #8454 for |
Backport failed for Please cherry-pick the changes locally. git fetch origin release-1.3.0
git worktree add -d .worktree/backport-8392-to-release-1.3.0 origin/release-1.3.0
cd .worktree/backport-8392-to-release-1.3.0
git checkout -b backport-8392-to-release-1.3.0
ancref=$(git merge-base 2c754a7d19d50455a1e790260477d03a2e760137 460fc6fe5ecf871aa100bcfa10d9f8bd8ec460c9)
git cherry-pick -x $ancref..460fc6fe5ecf871aa100bcfa10d9f8bd8ec460c9 |
8436: [Backport/stable 1.2] Fix ZeebePartition can be closed when there are ongoing transitions r=deepthidevaki a=deepthidevaki Backport of #8344 closes #7981 Due to merge conflicts, the commits that refactored the code are not backported. 8454: [Backport stable/1.2] fix(polling/state): prevent duplicates in repeatable requests list r=oleschoenburg a=github-actions[bot] # Description Backport of #8392 to `stable/1.2`. relates to #8310 #8390 Co-authored-by: Deepthi Devaki Akkoorath <deepthidevaki@gmail.com> Co-authored-by: Roman <roman.smirnov@camunda.com>
Description
Related issues
relates #8310
closes #8390
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/0.25
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation: