Skip to content

Move HasCommit check inside lock in DataModel.Add#66

Merged
myieye merged 1 commit into
mainfrom
claude/fix-harmony-toctou-lgtNW
May 19, 2026
Merged

Move HasCommit check inside lock in DataModel.Add#66
myieye merged 1 commit into
mainfrom
claude/fix-harmony-toctou-lgtNW

Conversation

@myieye
Copy link
Copy Markdown
Contributor

@myieye myieye commented May 18, 2026

Previously the duplicate-commit check ran before acquiring the repo lock, leaving space for a race condition.

Previously the duplicate-commit check ran before acquiring the repo
lock, leaving a TOCTOU window where two concurrent Add calls could
both see the commit as missing and proceed to insert it.

https://claude.ai/code/session_01TziA3LymLmdxXxUgXywq4B
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@myieye has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 11 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0276e9e3-1847-47a0-b32b-d189d590eca9

📥 Commits

Reviewing files that changed from the base of the PR and between fab2754 and 96a75b2.

📒 Files selected for processing (1)
  • src/SIL.Harmony/DataModel.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-harmony-toctou-lgtNW

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@myieye myieye merged commit 31dc78b into main May 19, 2026
4 of 6 checks passed
@myieye myieye deleted the claude/fix-harmony-toctou-lgtNW branch May 19, 2026 13:41
myieye added a commit to sillsdev/languageforge-lexbox that referenced this pull request May 20, 2026
Bump Harmony submodule to include the in-lock HasCommit check (sillsdev/harmony#66),
which closes the TOCTOU race between concurrent AddPredefinedMorphTypes callers
on a fresh project (BG sync's CreateProject vs. HTTP middleware's MigrateDb).

The MigrateDb pre-check was a small optimization, not a race guard — drop it,
let Harmony's in-lock check handle idempotency.

Note: won't build on develop until the .NET 10 chore lands (Harmony main is on .NET 10).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

3 participants