Skip to content

docs: client pool, isolated scopes, and abandon detection - #298

Draft
Aryex wants to merge 6 commits into
mainfrom
alexl/agent/client-pool-scoped-connections
Draft

Aryex wants to merge 6 commits into
mainfrom
alexl/agent/client-pool-scoped-connections

Conversation

@Aryex

@Aryex Aryex commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Document the Client-Instance Pool, Isolated Execution Scopes, and Abandon Detection features across Python, Java, Node.js, and Go.

⚠️ Attention: This PR was generated automatically. Verify that all relevant pages have been updated.

Source Commits

  • be92bbc — feat: cross-language client pool and isolated execution scopes (#6338)
  • 65e607b — feat: add abandon detection for pool-borrowed clients (#6642)

Changes

  • Added how-to/client-pool.mdx — guide covering pool configuration, creation, borrow/release patterns, metrics, abandon detection, and limitations
  • Added how-to/isolated-scope.mdx — guide covering scope acquisition, WATCH/MULTI/EXEC OCC retry patterns, cluster mode routing, and limitations
  • Updated astro.config.mjs sidebar to include both new pages
  • Added abandon_timeout_ms to the configuration table
  • Added "Abandon Detection" section documenting the background monitor, activity refresh, blocking command exclusion, custom timeout configuration, and disable instructions
  • Removed the "No abandon detection" limitation (now resolved)

Context

PR #6338 added a cross-language client-instance pool and isolated execution scopes. PR #6642 followed up with abandon detection — a background monitor that reclaims pool-borrowed clients after a configurable inactivity timeout. The timer resets on every command sent, and blocking commands are automatically excluded. These guides document the public API for all features with practical code examples in all four languages.

cc @jduo @jeremyprime


This PR was generated by the automated documentation pipeline.

@Aryex Aryex added documentation Improvements or additions to documentation go java nodejs python AI Generated labels Jul 28, 2026
@Aryex
Aryex force-pushed the alexl/agent/client-pool-scoped-connections branch from 151f14c to 1fd07da Compare August 8, 2026 08:03
@Aryex Aryex changed the title docs: client pool and isolated execution scopes docs: client pool, isolated scopes, and abandon detection Aug 8, 2026
@Aryex

Aryex commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

📝 Updated PR description with 65e607b — feat: add abandon detection for pool-borrowed clients (#6642)

Changes in this update:

  • Added abandon_timeout_ms to the Configuration table
  • Added new "Abandon Detection" section with configuration and disable examples across all 4 languages
  • Removed the "No abandon detection" limitation (now resolved)

@jeremyprime jeremyprime left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Multiple incorrect examples in both files. Here is AI summary:

client-pool.mdx:

Section Language Issue
Create a Pool Node Should be two args: ClientPool.create(clientConfig, { maxSize: 10, ... })
Borrow and Return Python (manual) _get_or_create_client() is private — remove manual example, keep only borrow() context manager
Borrow and Return Java acquire().get() returns PooledGlideClient (AutoCloseable). Fix: try (var client = pool.acquire().get()) { client.set(...); }
Borrow and Return Go Acquire(ctx) returns (int64, error), not a client. Need GetClient(clientID) then defer client.Close()
Pool Metrics Java No PoolMetrics class — use pool.getIdleCount(), pool.getActiveCount(), pool.getTotalCount()
Pool Metrics Node pool.metrics()pool.getMetrics()
Pool Metrics Go No Metrics() struct — use pool.IdleCount(), pool.ActiveCount(), pool.TotalCount()
Close the Pool Node pool.close() is synchronous — remove await

isolated-scope.mdx:

Section Language Issue
Acquire a Scope Node No client.scopedConnection() — use IsolatedScope.acquire(client, connectionRequestBytes, routingKey)
Acquire a Scope Node scope.close() / scope.release() is synchronous — remove await
Acquire a Scope Go No ScopeOptions struct — use positional args: client.ScopedConnection(ctx, timeout, routingKey)

@jeremyprime

Copy link
Copy Markdown
Collaborator

Multiple incorrect examples in both files. Here is AI summary:

client-pool.mdx:

Section Language Issue
Create a Pool Node Should be two args: ClientPool.create(clientConfig, { maxSize: 10, ... })
Borrow and Return Python (manual) _get_or_create_client() is private — remove manual example, keep only borrow() context manager
Borrow and Return Java acquire().get() returns PooledGlideClient (AutoCloseable). Fix: try (var client = pool.acquire().get()) { client.set(...); }
Borrow and Return Go Acquire(ctx) returns (int64, error), not a client. Need GetClient(clientID) then defer client.Close()
Pool Metrics Java No PoolMetrics class — use pool.getIdleCount(), pool.getActiveCount(), pool.getTotalCount()
Pool Metrics Node pool.metrics()pool.getMetrics()
Pool Metrics Go No Metrics() struct — use pool.IdleCount(), pool.ActiveCount(), pool.TotalCount()
Close the Pool Node pool.close() is synchronous — remove await
isolated-scope.mdx:

Section Language Issue
Acquire a Scope Node No client.scopedConnection() — use IsolatedScope.acquire(client, connectionRequestBytes, routingKey)
Acquire a Scope Node scope.close() / scope.release() is synchronous — remove await
Acquire a Scope Go No ScopeOptions struct — use positional args: client.ScopedConnection(ctx, timeout, routingKey)

Fixed in fb340ea.

kiro-agent and others added 4 commits August 20, 2026 22:22
Signed-off-by: kiro-agent <kiro-agent@users.noreply.github.com>
Signed-off-by: kiro-agent <kiro-agent@users.noreply.github.com>
…pe guides

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
…ing commands

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
@jeremyprime
jeremyprime force-pushed the alexl/agent/client-pool-scoped-connections branch from fb340ea to 9b32fdc Compare August 20, 2026 22:34
@jeremyprime

Copy link
Copy Markdown
Collaborator

Will keep this as draft until conn pool and scoped conn issues are addressed: https://github.com/valkey-io/valkey-glide/issues?q=is%3Aissue%20state%3Aopen%20label%3Apool%2Fscope

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated documentation Improvements or additions to documentation go java nodejs python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants