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

InFlightLongPollingActivateJobsRequestsState#activeRequestsToBeRepeated contains duplicates #8390

Closed
romansmirnov opened this issue Dec 14, 2021 · 1 comment · Fixed by #8392
Assignees
Labels
kind/bug Categorizes an issue or PR as a bug scope/gateway Marks an issue or PR to appear in the gateway section of the changelog

Comments

@romansmirnov
Copy link
Member

Describe the bug

See description in #8310:

Scenario 1: Duplicates in activeRequestsToBeRepeated when other requests succeeds

Given three activate requests x, y, and z:

  1. send request z to broker -> current activeRequests = [ z ] and activeRequestsToBeRepeated = [ ]
  2. send request y to broker -> current activeRequests = [ z, y ] and activeRequestsToBeRepeated = [ ]
  3. send request x to broker -> current activeRequests = [ z, y, x ] and activeRequestsToBeRepeated = [ ]
  4. request z completes with at least one activated job -> reset failed attempts -> current activeRequests = [ y, x ] and activeRequestsToBeRepeated = [ y, x ]
  5. request y completes with at least one activated job -> reset failed attempts -> current activeRequests = [ x ] and activeRequestsToBeRepeated = [ x, x ]

Scenario 2: Duplicates in activeRequestsToBeRepeated on multiple notifications

Given is a request x:

  1. send request x to broker -> current activeRequests = [ x ] and activeRequestsToBeRepeated = [ ]
  2. Broker notifies the gateway about new available jobs -> reset failed attempts -> current activeRequests = [ x ] and activeRequestsToBeRepeated = [ x ]
  3. Again, Broker notifies the gateway about new available jobs -> reset failed attempts -> current activeRequests = [ x ] and activeRequestsToBeRepeated = [ x, x ]

Scenario 3: Another request wins

Given are requests [z1, z2, z3, ...., zn] and x:

  1. send requests [z1, z2, z3, ...., zn] and x -> current activeRequests = [ z1, z2, z3, ...., zn, x ] and activeRequestsToBeRepeated = [ ]`
  2. request z1 completes with at least one activated job -> reset failed attempts -> current activeRequests = [ z2, z3, ...., zn, x ] and activeRequestsToBeRepeated = [ z2, z3, ...., zn, x ]
  3. request x completes without any jobs -> retry request -> current activeRequests = [ z2, z3, ...., zn, x ] and activeRequestsToBeRepeated = [ z2, z3, ...., zn ]
  4. request z2 completes with at least one activated job -> reset failed attempts -> current activeRequests = [ z3, ...., zn, x ] and activeRequestsToBeRepeated = [ z3, ...., zn, x ]
  5. request x completes without any jobs -> retry request -> current activeRequests = [ z3, ...., zn, x ] and activeRequestsToBeRepeated = [ z2, z3, ...., zn ]
  6. ...

In all scenarios, the queue activeRequestsToBeRepeated contains the request x at least once before the response arrives. In a nutshell, as long as the failed attempts are lower than the configured threshold and the request x is present in the queue of repeatable requests, the request x is executed in a loop when it responds with any activated job.

Expected behavior

  • InFlightLongPollingActivateJobsRequestsState#activeRequestsToBeRepeated does not contain duplicates

Environment:

  • Zeebe Version: 1.2.5
  • Configuration: Enabled Long Polling

is depended on by #8310

@romansmirnov romansmirnov added the kind/bug Categorizes an issue or PR as a bug label Dec 14, 2021
@romansmirnov romansmirnov self-assigned this Dec 14, 2021
@romansmirnov romansmirnov added the scope/gateway Marks an issue or PR to appear in the gateway section of the changelog label Dec 14, 2021
@romansmirnov
Copy link
Member Author

Moving back to the Ready column because I am currently not actively working on it.

@ghost ghost closed this as completed in dc9773d Dec 20, 2021
ghost pushed a commit that referenced this issue Dec 20, 2021
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>
ghost pushed a commit that referenced this issue Dec 20, 2021
8453: [Backport stable/1.1] fix(polling/state): prevent duplicates in repeatable requests list r=oleschoenburg a=github-actions[bot]

# Description
Backport of #8392 to `stable/1.1`.

relates to #8310 #8390

Co-authored-by: Roman <roman.smirnov@camunda.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes an issue or PR as a bug scope/gateway Marks an issue or PR to appear in the gateway section of the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants