Bug 1510040

Summary: Do not purge session if there are no sessions
Product: Red Hat CloudForms Management Engine Reporter: Keenan Brock <kbrock>
Component: PerformanceAssignee: Keenan Brock <kbrock>
Status: CLOSED CURRENTRELEASE QA Contact: Tasos Papaioannou <tpapaioa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.8.0CC: jhardy, kbrock, obarenbo, simaishi, tpapaioa
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.9.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 5.9.0.1 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
: 1510054 (view as bug list) Environment:
Last Closed: 2018-03-06 15:51:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1510054    

Description Keenan Brock 2017-11-06 15:15:54 UTC
Description of problem:

Every 30 seconds, we purge the sessions table. For most customers, this table is empty.
This schedules many background jobs that will never produce any work.


Version-Release number of selected component (if applicable):


How reproducible:

Always

Steps to Reproduce:
1. ssh to an appliance
2. cd to vmdb
3. get queue messages for the generic worker
4. extract and count the commands that were sent through the queue

```
ssh ...
vmdb
grep 'GenericWorker::Runner#get' log/evm.log>tmp/msg
ruby -ne 'puts $_.match(/Command: \[([^\]]*)\]/)[1]' tmp/msg|sort|uniq -c|sort -nr|head
```

Actual results:

One of the top 10 most popular commands is Session.check_session_timeout

Expected results:

It isn't

Additional info:

Comment 2 Dave Johnson 2017-11-06 15:44:18 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set the severity to Low.

Comment 4 Tasos Papaioannou 2017-12-01 19:50:35 UTC
Verified on 5.9.0.11.

With 

  :session_store: sql

evm.log shows Session.check_session_timeout gets regularly queued.