Deferred from PR #10635, whose description names it "deliberately left for a follow-up" — recording it so the follow-up has a tracker.
Behavior
PR #10635 closes the cloned connection behind the XEStore that Get-DbaXESession creates, which removed the bulk of the Extended Events connection leak. A smaller, separate mechanism remains: the emitted session objects keep a functional Store note property, and when a downstream command uses that store (piped Start-DbaXESession, Stop-DbaXESession, ...), SFC transparently reconnects it from the pool — and that reopened connection stays checked out, once per pipeline, until the process exits.
Measured in the lab (SQL03\SQL2019, isolated runner measurements of the family test files, after #10635): Start-DbaXESession still leaves 7 sleeping sessions (down from 15), Remove-DbaXESession 2 (from 6), ConvertTo-DbaXESession 3 (from 7). The residue is this reconnect mechanism.
Fix shape
Consumer-side disconnects: each command that operates through a piped object's store closes the store connection when it reopened it — several commands (Start-, Stop-, Remove-, ConvertTo-DbaXESession, the Watch/Export family), each with its own before/after measurement, following the counting-test pattern established in #10633–#10635. Needs care that a store used repeatedly within one command is not churned open/closed per operation.
Related: the sleeping-connection inventory that found the family (first -CheckSleepingConnections full lab run, 2026-08-28) and the ownership pattern from #10554.
This issue was created by Claude and reviewed by Andreas Jordan.
Deferred from PR #10635, whose description names it "deliberately left for a follow-up" — recording it so the follow-up has a tracker.
Behavior
PR #10635 closes the cloned connection behind the
XEStorethatGet-DbaXESessioncreates, which removed the bulk of the Extended Events connection leak. A smaller, separate mechanism remains: the emitted session objects keep a functionalStorenote property, and when a downstream command uses that store (pipedStart-DbaXESession,Stop-DbaXESession, ...), SFC transparently reconnects it from the pool — and that reopened connection stays checked out, once per pipeline, until the process exits.Measured in the lab (SQL03\SQL2019, isolated runner measurements of the family test files, after #10635):
Start-DbaXESessionstill leaves 7 sleeping sessions (down from 15),Remove-DbaXESession2 (from 6),ConvertTo-DbaXESession3 (from 7). The residue is this reconnect mechanism.Fix shape
Consumer-side disconnects: each command that operates through a piped object's store closes the store connection when it reopened it — several commands (
Start-,Stop-,Remove-,ConvertTo-DbaXESession, theWatch/Exportfamily), each with its own before/after measurement, following the counting-test pattern established in #10633–#10635. Needs care that a store used repeatedly within one command is not churned open/closed per operation.Related: the sleeping-connection inventory that found the family (first
-CheckSleepingConnectionsfull lab run, 2026-08-28) and the ownership pattern from #10554.This issue was created by Claude and reviewed by Andreas Jordan.