Skip to content

Commit 5f32b34

Browse files
torcolvinclaude
andauthored
CBG-5715: bound max_processes, mirror the _changes body defaults
max_processes is a uint, and db/event_manager.go:69-70 maps 0 to kMaxActiveEvents (500), so document minimum: 0 with the effective default and say what 0 means. Raised by Copilot on #8654. heartbeat and timeout in the _changes POST bodies now carry the same defaults and bounds already documented on the GET query parameters: heartbeat defaults to 0 and, when non-zero, is clamped up to kMinHeartbeatMS (25000); timeout defaults to kDefaultTimeoutMS (300000) and is capped at kMaxTimeoutMS (900000). See GetRestrictedInt, which readChangesOptionsFromJSON calls with allowZero=true. Copilot flagged these as heartbeat-only, but the timeout default is 300000, not 0. Also drops the revs_limit allow_conflicts note. Both branches it describes exist (db/database.go:504-508, rest/config.go:936-940) but neither is reachable from config: allow_conflicts=true is rejected in the same validateVersion (rest/config.go:1149-1150) and DefaultAllowConflicts is false, so only the test-only EnableAllowConflicts gets there. Raised by @factory-droid on #8656. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 1149c75 commit 5f32b34

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

docs/api/components/schemas.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,8 +1274,10 @@ Database:
12741274
type: boolean
12751275
default: false
12761276
max_processes:
1277-
description: The maximum amount of concurrent event handling independent functions that can be running at the same time.
1277+
description: The maximum amount of concurrent event handling independent functions that can be running at the same time. Setting to 0 uses the default.
12781278
type: integer
1279+
default: 500
1280+
minimum: 0
12791281
wait_for_process:
12801282
description: The maximum amount of time (in milliseconds) to wait when the event queue is full.
12811283
type: string
@@ -1613,8 +1615,6 @@ Database:
16131615
revs_limit:
16141616
description: |-
16151617
The maximum depth a document's revision tree can grow to.
1616-
1617-
Defaults to 100 when `allow_conflicts` is enabled, and must be at least 20 in that case.
16181618
type: integer
16191619
default: 50
16201620
minimum: 1

docs/api/paths/admin/keyspace-_changes.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,15 @@ post:
188188
items:
189189
type: string
190190
heartbeat:
191-
description: The interval (in milliseconds) to send an empty line (CRLF) in the response. This is to help prevent gateways from deciding the socket is idle and therefore closing it. This is only applicable to `feed=longpoll` or `feed=continuous`. This will override any timeouts to keep the feed alive indefinitely. Setting to 0 results in no heartbeat. The maximum heartbeat can be set in the server replication configuration.
191+
description: The interval (in milliseconds) to send an empty line (CRLF) in the response. This is to help prevent gateways from deciding the socket is idle and therefore closing it. This is only applicable to `feed=longpoll` or `feed=continuous`. This will override any timeouts to keep the feed alive indefinitely. Setting to 0 results in no heartbeat. The maximum heartbeat can be set in the server replication configuration. If heartbeat is non zero, it must be at least 25000 milliseconds.
192192
type: integer
193+
default: 0
193194
timeout:
194195
description: 'This is the maximum period (in milliseconds) to wait for a change before the response is sent, even if there are no results. This is only applicable for `feed=longpoll` or `feed=continuous` changes feeds. Setting to 0 results in no timeout.'
195196
type: integer
197+
default: 300000
198+
maximum: 900000
199+
minimum: 0
196200
feed:
197201
description: 'The type of changes feed to use. '
198202
type: string

docs/api/paths/public/keyspace-_changes.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,15 @@ post:
175175
items:
176176
type: string
177177
heartbeat:
178-
description: The interval (in milliseconds) to send an empty line (CRLF) in the response. This is to help prevent gateways from deciding the socket is idle and therefore closing it. This is only applicable to `feed=longpoll` or `feed=continuous`. This will override any timeouts to keep the feed alive indefinitely. Setting to 0 results in no heartbeat. The maximum heartbeat can be set in the server replication configuration.
178+
description: The interval (in milliseconds) to send an empty line (CRLF) in the response. This is to help prevent gateways from deciding the socket is idle and therefore closing it. This is only applicable to `feed=longpoll` or `feed=continuous`. This will override any timeouts to keep the feed alive indefinitely. Setting to 0 results in no heartbeat. The maximum heartbeat can be set in the server replication configuration. If heartbeat is non zero, it must be at least 25000 milliseconds.
179179
type: integer
180+
default: 0
180181
timeout:
181182
description: 'This is the maximum period (in milliseconds) to wait for a change before the response is sent, even if there are no results. This is only applicable for `feed=longpoll` or `feed=continuous` changes feeds. Setting to 0 results in no timeout.'
182183
type: integer
184+
default: 300000
185+
maximum: 900000
186+
minimum: 0
183187
feed:
184188
description: 'The type of changes feed to use. '
185189
type: string

0 commit comments

Comments
 (0)