Skip to content

fix(detectors): keep analysis whole while recording is still under way (#1212) - #1219

Merged
PIsberg merged 1 commit into
mainfrom
fix/analyze-under-recording
Nov 8, 2026
Merged

PIsberg merged 1 commit into
mainfrom
fix/analyze-under-recording

Conversation

@PIsberg

@PIsberg PIsberg commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Fixes the two detectors that turned DetectorAnalysisUnderConcurrentWritesTest red on and off.

CompletableFutureObtrudeDetector: NullPointerException on main at fd0f41659 (run 42398089347) and 1ab210caa (run 42373466647). stateFor publishes a future's state before recordObtrude sets its thread name, and analyze() put that null into Map.of. analyze now reads the count before the thread name, the reverse of the order recordObtrude sets them, and skips a future that has neither yet.

ThreadPoolDeadlockDetector: "reported issues with an empty structuredViolations list" on #1208 (run 42398751481). analyze() listed the pools, then read the detector-wide risk total. A submission recorded between the two left hasIssues() true with no pool listed. Each pool now keeps its own risk count, and analyze totals the pools it lists.

Corrects #1212's description: #1207 changed only AtomicityValidator, so it did not fix the first bug.

Tests

  • Each detector has a new test that builds the half-recorded state directly, with no timing involved. Both tests failed against the unfixed detectors (NPE and the checkedReport assertion) and pass with the fix.
  • DetectorAnalysisUnderConcurrentWritesTest passed 20 of 20 repeats locally.
  • Locally: mvn clean verify -DskipTests (static gates) and mvn -P fast test (3922 + 113 + 13, no failures).

Refs #1212

🤖 Generated with Claude Code

#1212)

CompletableFutureObtrudeDetector read a future's thread name before
recordObtrude had set it: stateFor publishes the state first, and the null
went into Map.of. analyze now reads the count before the thread name
(recordObtrude sets them in the reverse order) and skips a future with
neither yet.

ThreadPoolDeadlockDetector listed the pools, then read the detector-wide
risk count. A submission recorded between the two left hasIssues() true
with no pool listed, so checkedReport threw on the empty
structuredViolations. Each pool now keeps its own risk count and analyze
totals the pools it lists.

Both tests build the half-recorded state directly and failed before the
fix; DetectorAnalysisUnderConcurrentWritesTest passed 20 of 20 repeats.

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../diagnostics/CompletableFutureObtrudeDetector.java 71.42% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@PIsberg
PIsberg merged commit e8770e9 into main Nov 8, 2026
53 checks passed
@PIsberg
PIsberg deleted the fix/analyze-under-recording branch November 8, 2026 06:56
PIsberg added a commit that referenced this pull request Nov 8, 2026
…ambdas

Takes main's CompletableFutureObtrudeDetector fix (#1219) over this branch's narrower one, and main's copy of its test. CHANGELOG keeps main's #1173 and #1212 entries and adds this branch's three #1172 entries; the branch's obtrude entry is dropped as main's #1212 entry covers it.
PIsberg added a commit that referenced this pull request Nov 8, 2026
…analysis

Brings in #1209's merge of main, which takes main's CompletableFutureObtrudeDetector fix (#1219).
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