Skip to content

[fix][misc] Fix Backoff mandatory-stop timer tracking#23

Open
Denovo1998 wants to merge 4 commits into
masterfrom
fix_backoff_mandatory_stop_timer_tracking
Open

[fix][misc] Fix Backoff mandatory-stop timer tracking#23
Denovo1998 wants to merge 4 commits into
masterfrom
fix_backoff_mandatory_stop_timer_tracking

Conversation

@Denovo1998

@Denovo1998 Denovo1998 commented Mar 4, 2026

Copy link
Copy Markdown
Owner

Fixes: https://github.com/apache/pulsar/pull/25278/changes#r2878215799

Main Issue: #xyz

PIP: #xyz

Motivation

Backoff's mandatory-stop timer can be unintentionally reset when current == initial, which happens with constant backoff (initial == max) and after reduceToHalf() brings next back to initial. This prevents mandatoryStopMade from ever being reached and can cause retries to run longer than the configured mandatory stop.

Modifications

  • Track the mandatory-stop start time with an explicit flag so it is set only once per backoff cycle.
  • Reset the mandatory-stop timer state in reset().

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: apache#25282

@codecov

codecov Bot commented Mar 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.68%. Comparing base (9937d22) to head (96d2898).
⚠️ Report is 118 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master      #23       +/-   ##
=============================================
+ Coverage     30.86%   72.68%   +41.81%     
- Complexity       51    34073    +34022     
=============================================
  Files          1862     1959       +97     
  Lines        146347   155552     +9205     
  Branches      17011    17741      +730     
=============================================
+ Hits          45171   113056    +67885     
+ Misses        94161    33483    -60678     
- Partials       7015     9013     +1998     
Flag Coverage Δ
inttests 25.75% <100.00%> (-0.83%) ⬇️
systests 22.37% <36.36%> (-0.51%) ⬇️
unittests 73.64% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...in/java/org/apache/pulsar/common/util/Backoff.java 98.11% <100.00%> (+28.72%) ⬆️
...ain/java/org/apache/pulsar/io/kinesis/Backoff.java 87.17% <100.00%> (+87.17%) ⬆️

... and 1545 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

# Conflicts:
#	pulsar-common/src/main/java/org/apache/pulsar/common/util/Backoff.java
#	pulsar-io/kinesis/src/main/java/org/apache/pulsar/io/kinesis/Backoff.java
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