Session state is not properly reduced
I've noticed that some terminated sessions still appear in the
/v2/sessions
response because sessions8
still lists them as active, even though there is a session.terminated
event in the event log.
There are no related errors/warnings in the log so I'm not sure what's happening.
I'm running self-hosted 2.70.14 with PostgreSQL
8 Replies
hey @sp132 I think this is related to https://github.com/zitadel/zitadel/issues/10045#issuecomment-3167181873 I can check with marco if this still persists , is it still happening?
GitHub
[Bug]: expired session is not terminated properly · Issue #10045 ...
Preflight Checklist I could not find a solution in the documentation, the existing issues or discussions I have joined the ZITADEL chat Environment Self-hosted Version 2.70.11 Database PostgreSQL D...
It's a different problem, sadly.
The ticket describes a problem with sessions that are already expired, but in this case even session without a TTL still persists in sessions8 projection after termination (even though there is an
session_terminated
event in the event store)Any pointers?
hey @sp132 I will check it today
I'm happy to help, let me know if you need additional information
Correct me if I'm wrong, but it seems that
projections.sessions8
isn’t updated at all after the session is terminated.
https://github.com/zitadel/zitadel/blob/v2.70.14/internal/command/session.go#L331-L362
I suppose it relies on some background process then?GitHub
zitadel/internal/command/session.go at v2.70.14 · zitadel/zitadel
ZITADEL - Identity infrastructure, simplified for you. - zitadel/zitadel
It doesn't seem to be a one-off problem either
returns 21 rows ranging from 08/08 to present day. there could've been more if not for the clean up procedure we have in place
hey @sp132 can you pls open an issue, I know who can look into it, but they're bust atm. So kindly please open an issue and I will tag the relevent engineer.