Skip to content

DiskIO: lock the once-only failure log against sampler/marker race - #243

Merged
torlando-tech merged 1 commit into
mainfrom
fix/diskio-failure-log-lock
Oct 27, 2026
Merged

torlando-tech merged 1 commit into
mainfrom
fix/diskio-failure-log-lock

Conversation

@torlando-tech

Copy link
Copy Markdown
Owner

Follow-up to #240 (merged at 5ebff91, before this fix landed).

Greptile round 2 flagged a P2: logFailureOnce read/wrote loggedFailure without a lock, and the sampler calls DiskIO.sample() outside the trace lock, so it can race the stop marker's sample — worst case, two diagnosis lines in ext-diag.log instead of one. Fixed with a dedicated NSLock (check-and-set inside, log call outside).

Diff is 6 lines; full context and the 5/5 review it came from are on #240.

@torlando-tech

Copy link
Copy Markdown
Owner Author

@greptile review

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Protects DiskIO’s once-only failure message when the sampler and stop marker run at the same time.

  • Disk probe failures now produce one diagnosis line per process.

Reviews (1) · Last reviewed commit: "DiskIO: lock the once-only failure log a..." · Reviewed by Greptile

@torlando-tech
torlando-tech merged commit 34d1ebf into main Oct 27, 2026
3 checks passed
@torlando-tech
torlando-tech deleted the fix/diskio-failure-log-lock branch October 27, 2026 03:19
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