Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vyazelenko
Copy link
Contributor

This PR ensures that pub-lmt always stays within a safe boundary, i.e.:

  • either one term ahead of the dirty buffer.
  • or two terms ahead of the dirty buffer but only if the clean position offset is non zero, i.e. not an entire buffer is dirty.

Explanation: pub-lmt is a soft constraint, i.e. it can be breached by a publisher but only within a term boundary. This means that if the publisher fills an entire term and the following term is a dirty one then subscribers (sender or spies) might start reading the dirty data before conductor has a chance to clean it up. Therefore if the clean position is at the term start we don't allow pub-lmt to be in the previous term.

@vyazelenko vyazelenko requested review from mikeb01 and nickelaway May 6, 2025 13:18
@vyazelenko vyazelenko merged commit 714b209 into aeron-io:release/1.47.x May 9, 2025
44 checks passed
vyazelenko added a commit that referenced this pull request May 9, 2025
…into the dirty term. (#1794)

* [Java] Update `pub-lmt` on reaching the trip gain boundary.

* [Java] Prevent `pub-lmt` from wrapping around into dirty terms to prevent dirty data from being consumed (i.e. by sender or spies).

* [Java] Update tests.

* [C] Increment work count when `pub-lmt` is reset.

* [C] Prevent `pub-lmt` from wrapping around into dirty terms to prevent dirty data from being consumed (i.e. by sender or spies).

* [C] Align naming with the Java impl.

* [Java] Clarify logic using termId-based calculation.

* [C] Clarify logic using termId-based calculation.
@vyazelenko vyazelenko deleted the prevent-buffer-wrap-around branch May 9, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant