v3.138.0
·
52 commits
to master
since this release
- Reworked the internal table/query session pool (#2137, #2163):
- semaphore-based concurrency limit instead of an internal wait queue and
indexmap; - synchronous session creation in the caller goroutine (no background create goroutine per session slot);
- pool statistics are updated less frequently after finishing
internal.Pool.Withcall to reduce CPU overhead
- semaphore-based concurrency limit instead of an internal wait queue and
- Session pool behavior:
FIFOsemantics replaced withLIFOsemantics (read aboutLIFOadvantages in article)- when the pool limit is reached, session pool blocks on a semaphore until a slot is released, instead of registering on an internal wait queue
errPoolIsOverflowis no longer returned from the pool. Client can receive only context errors if context is done and pool cannot get session for worktrace.Table.OnPoolWaitcallbacks are no longer invoked (the hook remains in the trace API but is unused by the pool)- default create/close timeout has been reduced to 500 msec in order to achieve a faster failure, thus leading to earlier retry and successful call, rather than the default multi-second delay on a cold start or under overload conditions.
- Added
WithSessionPoolWarmUpSessionsdriver option: at driver initialization, pre-creates up toNsessions in the table client pool and the query explicit session pool (N > 0;N <= 0disables warm-up; default is no warm-up). The configuredNis stored in pool stats asWarmUp; the number of sessions actually created ismin(N, pool limit). Driver initialization fails if warm-up session creation fails - Trace/metrics (breaking for custom handlers):
- Added to
trace.{TablePoolStateChangeInfo,QueryPoolChange}fieldConcurrency - Marked as deprecated fields
IndexandWaitintrace.{TablePoolStateChangeInfo,QueryPoolChange}
- Added to
Full Changelog: v3.137.0...v3.138.0