chore(consumer): drop dead CircuitBreakerController.shouldProbe + fix docs#189
Merged
eschizoid merged 1 commit intoJun 18, 2026
Merged
Conversation
Owner
Author
|
@copilot please review |
Copilot stopped work on behalf of
eschizoid due to an error
June 18, 2026 18:40
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #189 +/- ##
============================================
- Coverage 77.08% 77.06% -0.02%
+ Complexity 752 749 -3
============================================
Files 72 72
Lines 2858 2856 -2
Branches 355 354 -1
============================================
- Hits 2203 2201 -2
Misses 489 489
Partials 166 166 ☔ View full report in Codecov by Harness. |
`shouldProbe` had zero production callers — the Javadoc advertised "a timer asks shouldProbe on each tick" but no such tick exists. The real OPEN → HALF_OPEN transition fires via a one-shot `scheduler.schedule(this::tryHalfOpen, openDuration, …)` future in `ConsumerHealthController.trip()`, so the delay itself encodes the threshold — no predicate, no polling. Surfaced by the post-#170 dead-code audit. The audit's broader claim (that the whole circuit-breaker pause path is dead) was a false positive — `recordOutcome` has two production callsites in `KPipeConsumer` and the full path is exercised by `KPipeCircuitBreakerIntegrationTest`. Only this single stranded helper needed to go. Changes: - Delete `CircuitBreakerController.shouldProbe(long, long)`. - Delete the two unit tests that exclusively exercised it. - Rewrite the class Javadoc's OPEN-state description to match the actual scheduler-based design (and update the test-class Javadoc). - Add a "Circuit breaker" row to §17 capability table in `.claude/CLAUDE.md` — the table was missing it entirely.
db5e5e8 to
0e4aaa4
Compare
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two-part cleanup surfaced by the CircuitBreaker wiring investigation that ran alongside #186–#188:
CircuitBreakerController.shouldProbe(long, long)helper and its two unit tests. Audit found zero production callers. The Javadoc claimed "a timer asksshouldProbeon each tick" — but no such tick exists in production. The real OPEN → HALF_OPEN transition fires viascheduler.schedule(this::tryHalfOpen, openDuration, …)inConsumerHealthController.trip(), so the delay itself encodes the threshold (no predicate, no polling)..claude/CLAUDE.md— the table was missing it entirely, despite the feature being public on both the fluent facade (Stream.withCircuitBreaker(...)/MultiBuilder.withCircuitBreaker(...)) and the explicit Builder (Builder.withCircuitBreaker(CircuitBreakerController)).Why this is safe
The investigation explicitly verified:
shouldProbecallers in production: zero. Test-only callers: 4 assertions across 2 test methods, both inCircuitBreakerControllerTest.recordOutcomecallers in production:KPipeConsumer.java:1647(success path) +KPipeConsumer.java:1765(failure path). The full circuit-breaker pause path is wired and exercised byKPipeCircuitBreakerIntegrationTest.This PR only touches the helper, not the wiring.
Test plan
./gradlew :lib:kpipe-consumer:test --tests "*CircuitBreaker*"→ BUILD SUCCESSFULKPipeCircuitBreakerIntegrationTestcontinues to pass on next push