GutoVeronezi commented on PR #7132:
URL: https://github.com/apache/cloudstack/pull/7132#issuecomment-1408938773
@rohityadavcloud @nvazquez
I have tested the task with retention of 1 hour and interval of 1 hour;
therefore, in the worst case, the entry would exist for almost 2 hours:
- generated some sessions:

- after 1 hour, the task executed; however, as the session were removed
after `current time - 1 hour`, no sessions were expunged (as expected):
```
daniel@mgmt01:~$ sudo grep 'Starting ConsoleSessionCleanupTas'
/var/log/cloudstack/management/management-server.log
2023-01-30 14:56:20,776 DEBUG [o.a.c.c.ConsoleAccessManagerImpl]
(ConsoleSession-Scavenger-1:ctx-284d7f68) (logid:3662c3ad) Starting
ConsoleSessionCleanupTask...
daniel@mgmt01:~$ sudo grep 'logid:3662c3ad'
/var/log/cloudstack/management/management-server.log
2023-01-30 14:56:20,776 DEBUG [o.a.c.c.ConsoleAccessManagerImpl]
(ConsoleSession-Scavenger-1:ctx-284d7f68) (logid:3662c3ad) Starting
ConsoleSessionCleanupTask...
```
- after the first run, I generated two more sessions:

- then, in the second run, 4 sessions were expunged (as expected):
```
daniel@mgmt01:~$ sudo grep 'Starting ConsoleSessionCleanupTas'
/var/log/cloudstack/management/management-server.log
2023-01-30 14:56:20,776 DEBUG [o.a.c.c.ConsoleAccessManagerImpl]
(ConsoleSession-Scavenger-1:ctx-284d7f68) (logid:3662c3ad) Starting
ConsoleSessionCleanupTask...
2023-01-30 15:56:20,823 DEBUG [o.a.c.c.ConsoleAccessManagerImpl]
(ConsoleSession-Scavenger-1:ctx-659e1257) (logid:407a5e2e) Starting
ConsoleSessionCleanupTask...
daniel@mgmt01:~$ sudo grep 'logid:407a5e2e'
/var/log/cloudstack/management/management-server.log
2023-01-30 15:56:20,823 DEBUG [o.a.c.c.ConsoleAccessManagerImpl]
(ConsoleSession-Scavenger-1:ctx-659e1257) (logid:407a5e2e) Starting
ConsoleSessionCleanupTask...
2023-01-30 15:56:20,832 INFO [o.a.c.c.ConsoleAccessManagerImpl]
(ConsoleSession-Scavenger-1:ctx-659e1257) (logid:407a5e2e) Expunged 4 removed
console session records
```

The functionality is working as expected; I think we could improve the logs,
though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]