Skip to content

CP-53843: reusable SM session#7002

Open
GabrielBuica wants to merge 4 commits intoxapi-project:masterfrom
GabrielBuica:private/dbuica/CP-53843
Open

CP-53843: reusable SM session#7002
GabrielBuica wants to merge 4 commits intoxapi-project:masterfrom
GabrielBuica:private/dbuica/CP-53843

Conversation

@GabrielBuica
Copy link
Copy Markdown
Contributor

Builds on top of #6991

This is meant to reuse the same xapi session for sm_exec calls.

@psafont
Copy link
Copy Markdown
Member

psafont commented Apr 10, 2026

This seems like it would fix some issues I've seen in XCP-ng customers, but it's difficult to tell with the very short description, could you explain a bit further of what's the effect?

In particular, the problem is that some sessions used for long-running migrations are being evicted from the cache because of the amount of new sessions being created by SM.

Gabriel Buica added 4 commits April 13, 2026 15:02
`exec_with_new_*` function create orphaned traces for subtasks with
parents not in the database.

This is meant to address this and link these spans to their correct
parent.

Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
refactor the code before implementing reusable sessions for `sm_exec`

Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
The session reuse logic in `xapi_session.ml` does work in this usecase,
sm calls are made with `pool=false`. So reimplement the logic so that we
use a single session for `sm_exec`.

This should help with session count inside xapi.

Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
@GabrielBuica GabrielBuica force-pushed the private/dbuica/CP-53843 branch from 2efe3c2 to 244b3a1 Compare April 13, 2026 14:03

let create_session ~__context =
let host = !Xapi_globs.localhost_ref in
let session =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need a let here?

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