Skip to content

Enforce maxFetchSize = 1 on the AbstractFetchLimitingMessageSource from the StandardRotationPolicy when mode is fair #8967

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

Closed
artembilan opened this issue Feb 26, 2024 · 0 comments

Comments

@artembilan
Copy link
Member

In fair mode the StandardRotationPolicy re-configures AbstractFetchLimitingMessageSource for a new directory (and possible new ConnectionFactory) in the beforeReceive().
However with default maxFetchSize (or bigger than 1), the receive() would poll toBeReceived internal queue for files cached from the previous polling cycle.
Since we rotate the source immediately to a new set of options, all those cached files don't make sense or even can cause the problem on fetching their content in case of AbstractRemoteFileStreamingMessageSource when we rotate to a new ConnectionFactory.

See more info in the: #8898

@artembilan artembilan added this to the 6.3.0-M2 milestone Feb 26, 2024
artembilan added a commit that referenced this issue Feb 26, 2024
Fixes: #8967

In the `fair` mode the `StandardRotationPolicy` re-configures an `AbstractFetchLimitingMessageSource`
for a new directory (and possible new `ConnectionFactory`) in the `beforeReceive()`.
However, with default `maxFetchSize` (or bigger than `1`), the `receive()`` would poll `toBeReceived` internal queue
 for files cached from the previous polling cycle.
Since we rotate the source immediately to a new set of options, all those cached files make no sense
or even can cause the problem on fetching their content in case of `AbstractRemoteFileStreamingMessageSource`
when we rotate to a new `ConnectionFactory`.

* Call `fetchLimitingMessageSource.setMaxFetchSize(1);` in the `StandardRotationPolicy.beforeReceive()`
when `fair && !this.initialized`

**Auto-cherry-pick to `6.1.x`**
artembilan added a commit that referenced this issue Feb 26, 2024
Fixes: #8967

In the `fair` mode the `StandardRotationPolicy` re-configures an `AbstractFetchLimitingMessageSource`
for a new directory (and possible new `ConnectionFactory`) in the `beforeReceive()`.
However, with default `maxFetchSize` (or bigger than `1`), the `receive()`` would poll `toBeReceived` internal queue
 for files cached from the previous polling cycle.
Since we rotate the source immediately to a new set of options, all those cached files don't make sense
or even can cause the problem on fetching their content in case of `AbstractRemoteFileStreamingMessageSource`
when we rotate to a new `ConnectionFactory`.

* Call `fetchLimitingMessageSource.setMaxFetchSize(1);` in the `StandardRotationPolicy.beforeReceive()`
when `fair && !this.initialized`

(cherry picked from commit c78630e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants