Skip to content

Preserve VoteLog query failures in Control inspections - #1767

Draft
BenCodez wants to merge 2 commits into
masterfrom
fix/control-votelog-query-outcomes
Draft

BenCodez wants to merge 2 commits into
masterfrom
fix/control-votelog-query-outcomes

Conversation

@BenCodez

@BenCodez BenCodez commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

A VoteLog query that failed after the readability probe could look like an empty history or a zero count in Control. Control inspections now return UNAVAILABLE when a search, trace, aggregate or service-health query fails. Genuine empty results still succeed, and ordinary VoteLog callers retain their fallbacks. The wire schema and configuration are unchanged.

Hosted Maven validated head 403ee8ff with 3,375 unit tests with one skip and eight packaged-artifact checks passed. There were zero failures or errors. Build log The focused JDBC regression suite reproduced five failures on the original source. The corrected inspection/protocol suite passed all 64 focused tests in local validation. Live database and server acceptance remain unverified.

Summary by CodeRabbit

  • Bug Fixes

    • Vote-log inspections now report Unavailable when a query fails, rather than showing a misleading empty result or zero value. Genuine empty results remain successful.
    • Other vote-log reads retain their existing fallback behavior.
  • Documentation

    • Clarified inspection results and the limits of the readability check.
    • Updated deployment guidance with the required authentication headers.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

VoteLog inspection reads now return unavailable when a later SQL query fails. The read scope is limited to the inspection worker and restored on exit. Ordinary VoteLog callers retain their existing fallback results. The deployment contract also updates its artifact request example.

Changes: VoteLog inspection read failures

Layer / File(s) Summary
Scope and report VoteLog query failures
VotingPlugin/src/main/java/com/bencodez/votingplugin/votelog/VoteLogReadScope.java, VotingPlugin/src/main/java/com/bencodez/votingplugin/votelog/VoteLogMysqlTable.java
VoteLogReadScope installs a worker-local failure callback and restores the previous scope on exit. VoteLog SQL failure paths notify the active scope before returning their existing fallback values.
Apply strict scope to inspections
VotingPlugin/src/main/java/com/bencodez/votingplugin/control/ControlInspectionService.java, VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/control/VoteLogQueryFailureTest.java, AGENTS.md, docs/control-agent-contract.md
Inspection dispatch runs inside the read scope and throws InspectionUnavailableException when a query fails. Tests cover probe and query failures, recovery, fallback behavior, scope restoration, and thread isolation. The guidance and contract describe the strict scope and its point-in-time probe. Genuine empty results remain successful.

Artifact request contract

Layer / File(s) Summary
Document artifact request headers
docs/control-agent-contract.md
The artifact request example now specifies bearer authentication and explicit node-session and leased-attempt headers.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ControlInspectionService
  participant VoteLogReadScope
  participant VoteLogMysqlTable
  ControlInspectionService->>VoteLogReadScope: Install failure callback and run inspection
  ControlInspectionService->>VoteLogMysqlTable: Query VoteLog
  VoteLogMysqlTable->>VoteLogReadScope: Report SQL failure
  VoteLogReadScope-->>ControlInspectionService: Raise InspectionUnavailableException
Loading
Merge Risk: Minimal · up to 403ee

VoteLog inspections now report later SQL failures as unavailable instead of returning empty or zero results. Ordinary callers keep their existing fallbacks. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Preserve VoteLog query failures in Control inspections" matches the main change. The changeset makes VoteLog SQL read failures during Control inspections return UNAVAILABLE through a new wo…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Preserve VoteLog query failures in Control inspections" matches the main change. The changeset makes VoteLog SQL read failures during Control inspections return UNAVAILABLE through a new worker-local read scope, instead of silently falling back to empty or zero results. The title is specific, short, and names the affected area. The objectives describe the same behavior.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5797975a-ac53-4202-a0a2-38e9dfe86e76
Commits

Reviewing files that changed from the base of the PR and between 789cae1 and 403ee8f.

Files selected for processing: 6

  • AGENTS.md
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/control/ControlInspectionService.java
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/votelog/VoteLogMysqlTable.java
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/votelog/VoteLogReadScope.java
  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/control/VoteLogQueryFailureTest.java
  • docs/control-agent-contract.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: build
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (actions)
Additional context used

Code guidelines: 1

AGENTS.md — auto-discovered
Path-based instructions: 2

Source excerpt: VotingPlugin is the vote-processing data plane for Bukkit/Paper and BungeeCord/Velocity networks.

CodeRabbit inference engine (AGENTS.md)

Files:

  • AGENTS.md
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/control/ControlInspectionService.java
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/votelog/VoteLogMysqlTable.java
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/votelog/VoteLogReadScope.java
  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/control/VoteLogQueryFailureTest.java
  • docs/control-agent-contract.md
Source excerpt: All Java project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage.

CodeRabbit inference engine (AGENTS.md)

Files:

  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/control/VoteLogQueryFailureTest.java
LanguageTool

AGENTS.md

[grammar] ~184-~184: Use a hyphen to join words.
Context: ...ead failure returns UNAVAILABLE, never successful empty/zero data. Restore the ...

(QB_NEW_EN_HYPHEN)

This branch has not been deployed

No deployments
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.

2 participants