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:
     
![image](https://user-images.githubusercontent.com/38945620/215531452-0c5f098a-8a94-42e1-a2e5-5bcae2617b70.png)
   
   - 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:
     
![image](https://user-images.githubusercontent.com/38945620/215533503-248caea2-0bb8-4da8-8695-323385166e3b.png)
   
   
   - 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
     ``` 
   
     
![image](https://user-images.githubusercontent.com/38945620/215534025-3dfa0319-3fbd-47a8-9fa4-845718c27e2f.png)
   
   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]

Reply via email to