Skip to content

Fix XAPI session leak by vdi_is_open#475

Open
Nambrok wants to merge 1 commit intomasterfrom
dtt-fix-session-leak-is-open
Open

Fix XAPI session leak by vdi_is_open#475
Nambrok wants to merge 1 commit intomasterfrom
dtt-fix-session-leak-is-open

Conversation

@Nambrok
Copy link
Copy Markdown
Contributor

@Nambrok Nambrok commented Apr 15, 2026

In the case of vdi_is_open tests, we are using a script to obtain the sr_ref of XAPI. This script doesn't free the XAPI session it obtained.

Apr 15 09:46:55 r620-x1 xapi: [debug||115 db_gc|DB GC D:d2304dcf287c|db_gc_util] Session.destroy _ref=OpaqueRef:77699499-92e7-ad96-2703-fc53adaae642 uuid=e8a67d26-9aae-4451-ea87-66a3180141fb trackid=3c4e5b67d27d1b17ff45f3e41b478632 (last active 20260414T07:46:32Z): Timed out session in group 'originator:xcp-ng-tests session' because of its age

This add the logout to the script to avoid leaking the session.

@Nambrok Nambrok requested review from a team as code owners April 15, 2026 15:33
Comment thread tests/storage/storage.py Outdated
In the case of `vdi_is_open` tests, we are using a script to obtain the sr_ref of XAPI.
This script doesn't free the XAPI session it obtained.
```
Apr 15 09:46:55 r620-x1 xapi: [debug||115 db_gc|DB GC D:d2304dcf287c|db_gc_util] Session.destroy _ref=OpaqueRef:77699499-92e7-ad96-2703-fc53adaae642 uuid=e8a67d26-9aae-4451-ea87-66a3180141fb trackid=3c4e5b67d27d1b17ff45f3e41b478632 (last active 20260414T07:46:32Z): Timed out session in group 'originator:xcp-ng-tests session' because of its age
```
This add the logout to the script to avoid leaking the session.

Signed-off-by: Damien Thenot <damien.thenot@vates.tech>
Co-authored-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Nambrok Nambrok force-pushed the dtt-fix-session-leak-is-open branch from ee83e03 to 154e71e Compare April 15, 2026 15:45
@glehmann
Copy link
Copy Markdown
Member

nitpicking: "session leak" seems scarier than necessary. I'd rather call it "dangling session"

@Nambrok
Copy link
Copy Markdown
Contributor Author

Nambrok commented Apr 16, 2026

nitpicking: "session leak" seems scarier than necessary. I'd rather call it "dangling session"

Leak completely describe the situation though ^^

@glehmann
Copy link
Copy Markdown
Member

It's not leaked in the sense that someone can't get the token or whatever represents the session and do something not allowed. The session is still open for the server, but nobody can use it.
I guess you used it as in "memory leak", I read it as in "secret leak" :)

@stormi
Copy link
Copy Markdown
Member

stormi commented Apr 16, 2026

Can we merge?

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.

4 participants