Skip to content

feat(config): prefer read concurrency limit#356

Merged
yordis merged 1 commit into
masterfrom
yordis/feat-read-concurrency-limit
May 14, 2026
Merged

feat(config): prefer read concurrency limit#356
yordis merged 1 commit into
masterfrom
yordis/feat-read-concurrency-limit

Conversation

@yordis
Copy link
Copy Markdown
Member

@yordis yordis commented May 13, 2026

  • Operators need one clear read concurrency knob that describes the runtime pressure being controlled.
  • Conflicting old and new read concurrency settings should fail early instead of producing ambiguous startup behavior.

@cursor
Copy link
Copy Markdown

cursor Bot commented May 13, 2026

PR Summary

Medium Risk
Renames a database configuration knob used to size read processing, which may break existing deployments still using ReaderThreadsCount/--reader-threads-count and change default behavior (now 0 for autoconfig). Changes are localized but affect startup configuration and runtime read concurrency sizing.

Overview
Updates the server to use a single read-concurrency configuration knob by replacing ReaderThreadsCount with ReadConcurrencyLimit throughout configuration (ClusterVNodeOptions.DatabaseOptions) and startup sizing (ClusterVNode calling ThreadCountCalculator).

Refreshes docs and CLI/YAML/env var names to match (--read-concurrency-limit, ReadConcurrencyLimit, EVENTSTORE_READ_CONCURRENCY_LIMIT) and documents the default as 0 (autoconfig), with log messages updated accordingly.

Reviewed by Cursor Bugbot for commit 763b7b2. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Review Change Stack

Walkthrough

This PR renames the read-threading configuration option from ReaderThreadsCount to ReadConcurrencyLimit throughout the codebase. The default value changes from 4 to 0. The change flows through the configuration schema, runtime initialization, user-facing documentation, and internal logging.

Changes

Read Concurrency Configuration Rename

Layer / File(s) Summary
Configuration schema definition
src/EventStore.Core/Configuration/ClusterVNodeOptions.cs
DatabaseOptions property is renamed from ReaderThreadsCount to ReadConcurrencyLimit with default 0.
Configuration consumption in runtime
src/EventStore.Core/ClusterVNode.cs
ClusterVNode constructor passes options.Database.ReadConcurrencyLimit instead of ReaderThreadsCount to thread count calculation.
Documentation updates
docs/configuration.md, docs/db-config.md, docs/server-settings.md
Configuration tables and sections updated with new flag names (--read-concurrency-limit), YAML keys (ReadConcurrencyLimit), environment variables (EVENTSTORE_READ_CONCURRENCY_LIMIT), and default value 0 across all three documentation files.
Logging message updates
src/EventStore.Core/Settings/ThreadCountCalculator.cs
Serilog message templates updated to reference ReadConcurrencyLimit terminology in all thread count calculation paths (configured count, containerized environment, processor-clamped paths).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A reader's name doth change with grace,
From threads counted to limits placed,
Through docs and logs the rename flows,
With zero now as default shows,
This little hop completes the way!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(config): prefer read concurrency limit' accurately summarizes the main change: replacing ReaderThreadsCount with ReadConcurrencyLimit across configuration files and code.
Description check ✅ Passed The description explains the rationale for the change: providing a single clear configuration option for read concurrency and enforcing early validation for conflicting settings.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/feat-read-concurrency-limit

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.

@yordis yordis force-pushed the yordis/feat-read-concurrency-limit branch 2 times, most recently from 4f9bb1e to a27c602 Compare May 14, 2026 01:40
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis force-pushed the yordis/feat-read-concurrency-limit branch from a27c602 to 763b7b2 Compare May 14, 2026 02:46
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/configuration.md (1)

202-203: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update stale option name in WhatIf sample.

Line 202 still shows READER THREADS COUNT, which conflicts with the renamed ReadConcurrencyLimit docs on this page.

Suggested doc fix
-         READER THREADS COUNT:                    0 (<DEFAULT>)
+         READ CONCURRENCY LIMIT:                  0 (<DEFAULT>)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/configuration.md` around lines 202 - 203, Update the stale option name
in the WhatIf sample by replacing the old "READER THREADS COUNT" entry with the
new option name "ReadConcurrencyLimit" so the sample matches the renamed
configuration documented elsewhere; ensure the value and default comment remain
the same (e.g., "ReadConcurrencyLimit: 0 (<DEFAULT>)") and update any nearby
references in the same sample that mention READER THREADS COUNT.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/configuration.md`:
- Around line 202-203: Update the stale option name in the WhatIf sample by
replacing the old "READER THREADS COUNT" entry with the new option name
"ReadConcurrencyLimit" so the sample matches the renamed configuration
documented elsewhere; ensure the value and default comment remain the same
(e.g., "ReadConcurrencyLimit: 0 (<DEFAULT>)") and update any nearby references
in the same sample that mention READER THREADS COUNT.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73e09c7f-d044-4a63-9057-1ca608ceca49

📥 Commits

Reviewing files that changed from the base of the PR and between 4b0b9f7 and 763b7b2.

📒 Files selected for processing (7)
  • docs/configuration.md
  • docs/db-config.md
  • docs/server-settings.md
  • src/EventStore.Core/ClusterVNode.cs
  • src/EventStore.Core/Configuration/ClusterVNodeOptions.cs
  • src/EventStore.Core/Configuration/ClusterVNodeOptionsValidator.cs
  • src/EventStore.Core/Settings/ThreadCountCalculator.cs

@yordis yordis merged commit 3860089 into master May 14, 2026
9 checks passed
@yordis yordis deleted the yordis/feat-read-concurrency-limit branch May 14, 2026 02:49
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