Repository navigation
fix(resilience): a probe intervalSec under 1 is refused - #567
Merged
Merged
Conversation
POST /api/resilience took any probe intervalSec. The probe monitor sleeps that long between rounds, so at 0 it ran exec calls into the broker pods back to back for the whole fault. It is now a 400 naming the probe, as probes[1].intervalSec, before the stream starts. The book's resilience section gives the default and the floor. The two new imports move ResilienceResource's anchored MCP ref to 109-139.
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.
Why
Audit finding 13 (2026-10-29).
POST /api/resilienceaccepted any probeintervalSec.ResilienceOrchestrator's probe monitor sleepsintervalSec * 1000ms between rounds of theContinuousprobes, so"intervalSec": 0rankubectl exec-style calls into the broker pods back to back for the whole fault. One bad request could flood the Kubernetes API.What changed
ResilienceResource.executeResilienceTestrefuses a probe withintervalSec < 1with a400 Validation Failed, before the stream starts and before the safety and concurrency checks.fieldErrorsnames each probe by index (probes[1].intervalSec), the way bean validation names list elements. A null entry inprobesis skipped here, as before.POST /api/resilience/scenarios/{id}) bring their own probes fromKafkaProbes, at 10 to 15 s.docs/book/11-api-reference.mdsay so; the book also gives the default (10).ResilienceResource.java's anchored ref incli/cmd/mcp_tools_runs_activity.gofrom107-137to109-139. The new method sits below that range.Tests
ResilienceResourceTest.aProbeIntervalUnderOneSecondIsRefusedByItsIndex: two probes, the second at 0. 400, onlyprobes[1].intervalSecis named, and the orchestrator is never called. Without the fix the request gets a 200.Local runs:
cd kates && ./mvnw test -Dquarkus.grpc.codegen.skip=true -Dquarkus.http.test-port=0: BUILD SUCCESS, 1789 tests, 0 failures, 0 errors, 3 skippedspotless:check(JDK 25): cleancd cli && go test -count=1 ./cmd -run 'TestMCPCaveat|Anchor': passgolangci-lint run --new-from-rev=origin/main ./...: 0 issuesscripts/check-book-style.sh: OKOnly CI can run the integration tests, the native image, Docker, CodeQL and the Quarto book render.
Deliberately not done
Math.max(1, …)): nothing inside Kates builds a probe under 1, so the request check covers every path.timeoutSechas no floor either. Finding 13 was only about the interval; a 0 timeout fails the probe rather than spinning.