Repository navigation
Conversation
State.sizeManager was a public field, letting callers outside this class reach into SizeManager directly instead of going through the State-accepting static helpers. Narrow it to package-private and add the missing tryReserve(State) wrapper so external callers (e.g. an upcoming ConcurrentHashtable consumer) have a sanctioned lock-free reservation entry point instead of needing sizeManager exposed. Also move createBounded from the nested State class onto ConcurrentHashtable directly for a nicer call site, per review discussion on PR #12367. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d2f878bdf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| public static <TEntry extends Entry> boolean tryReserve(@Nonnull State<TEntry> state) { | ||
| return state.sizeManager.tryReserve(); |
There was a problem hiding this comment.
Keep reservation and duplicate recheck atomic
When a custom table follows the advertised lock-free find→reserve→insert flow, concurrent misses for the same logical key cannot be handled correctly by this boolean-only reservation. If one thread claims the last slot before linking its entry, another thread misses and receives false, dropping an occurrence that should have matched the in-flight entry; with multiple slots available, both threads can reserve, after which a locked duplicate recheck must either insert a duplicate or abandon one reservation and permanently consume capacity. The reservation must cover the locked duplicate recheck and insertion, or provide a way to release an unused claim.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
More details
The moved factory retains the same construction logic, and the reservation wrapper delegates directly to the existing size-manager operation. The completed static reviewer confirmed that affected repository callers were updated and returned no reportable findings.
🤖 Bits Code Review · Commit 9d2f878
What Does This Do
Two small, uncontroversial
ConcurrentHashtableAPI cleanups surfaced during review of #12367 (the first real external consumer ofConcurrentHashtable):SizeManager.State.sizeManagerwas a public field, so a caller with aStatereference could reach intoSizeManagerdirectly instead of going through theState-accepting static helpers (estimateSize,isFull,tryReserveOrEvict,evictOne,evictAll). That's now package-private. It was also missing a lock-freetryReserve(State)wrapper — the one operation an external caller doing custom find/reserve/insert (likeLogCollectorin Use ConcurrentHashtable for telemetry log #12367) actually needs — so callers no longer have to bypass encapsulation just to call it.createBounded. Moved from the nestedConcurrentHashtable.State.createBounded(...)ontoConcurrentHashtable.createBounded(...)directly for a nicer call site.D1.createBounded/D2.createBoundednow delegate to it.Pure refactor — no behavior change. Existing tests updated only to call
ConcurrentHashtable.createBoundedinstead ofConcurrentHashtable.State.createBounded.Motivation
See the review thread on #12367 (comments from @dougqh):
These are the least controversial items from that discussion; a couple of other, more design-heavy follow-ups (a lock-free find/matcher primitive avoiding boxed composite keys, and a doc note on the
bucketAt/isFullcomposability hazard) are being tracked separately and are not part of this PR.Contributor Checklist
🤖 Generated with Claude Code