Skip to content

Limit number of cleanup operations to same as connection size#93

Merged
oskarszoon merged 2 commits into
bsv-blockchain:mainfrom
oskarszoon:bugfix/bass-aerospike-conns
Oct 31, 2025
Merged

Limit number of cleanup operations to same as connection size#93
oskarszoon merged 2 commits into
bsv-blockchain:mainfrom
oskarszoon:bugfix/bass-aerospike-conns

Conversation

@oskarszoon

@oskarszoon oskarszoon commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Also make sure .Query respects any defined connection sizes using the existing semaphore Removed because streaming result set from query will not respect the connection limit. Actual connection limit usage will be limited by number of concurrent operations from cleanup

@github-actions

github-actions Bot commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Status: Complete


Current Review: No issues found

The PR correctly limits cleanup operations to the Aerospike connection queue size to prevent connection exhaustion. The implementation:

  1. Adds GetConnectionQueueSize() method to expose the connection semaphore capacity
  2. Auto-detects the appropriate limit from the connection queue size (with optional manual override)
  3. Changes default from hardcoded 128 to 0 (auto-detect mode)
  4. Uses the computed limit for the errgroup concurrency control in cleanup processing

The logic correctly prioritizes the connection queue size as an upper bound while allowing optional configuration via settings for tighter control.

@oskarszoon oskarszoon force-pushed the bugfix/bass-aerospike-conns branch from e536ed0 to 1e702e0 Compare October 31, 2025 14:56
@sonarqubecloud

Copy link
Copy Markdown

@oskarszoon oskarszoon requested a review from ordishs October 31, 2025 15:19
@oskarszoon oskarszoon merged commit 1126e89 into bsv-blockchain:main Oct 31, 2025
9 checks passed
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