Bug 1161244

Summary: access to apps via CNAMEs is not counted in last_access
Product: OpenShift Container Platform Reporter: Brenton Leanhardt <bleanhar>
Component: ContainersAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 2.2.0CC: adellape, agrimm, cryan, dmcphers, jokerman, libra-bugs, libra-onpremise-devel, mmccomas, xiama
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-origin-node-util-1.31.3.1-1 Doc Type: Bug Fix
Doc Text:
Previously when determining the last access time for a gear, the oo-last-access command did not count access via application aliases. This caused the command to return inaccurate last access information. This bug fix updates the oo-last-access command to also check for access via application aliases, and as a result the command output is now more accurate.
Story Points: ---
Clone Of: 1160770 Environment:
Last Closed: 2014-12-10 13:25:05 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: 1160770    
Bug Blocks:    

Description Brenton Leanhardt 2014-11-06 18:08:13 UTC
+++ This bug was initially created as a clone of Bug #1160770 +++

Description of problem:

If an openshift app has a cname, the hits to the app's cname are logged with that name in the apache log, and oo-last-access does not count those as "access" for the purpose of keeping an app from idling.

Version-Release number of selected component (if applicable):
rubygem-openshift-origin-node-1.31.9-1.el6oso.noarch

How reproducible:
always

Steps to Reproduce:
1. create an app
2. add a cname
3. access the site by the cname
4. run oo-last-access

Actual results:

oo-last-access for the gear will not reflect the hits to the cname

Expected results:

oo-last-access should count hits to any cname for an app, as well as its "canonical" name.

--- Additional comment from Andy Grimm on 2014-11-05 16:02:13 EST ---

Possible solution in https://github.com/a13m/origin-server/commit/a4e1a8b7d7c24736c1a29151e16577d605dd48a9

Could use some optimization, but it worked in my test...

Comment 3 Ma xiaoqiang 2014-12-02 02:13:00 UTC
Check on puddle [2.2.2/2014-11-26.3]

1. Create app on node.
#rhc app create testapp python-2.6
2. Add alias to the app.
#rhc alias add testapp.com -a testapp
3. Access the app via the alias
#echo testapp.com   $node_ip  >>/etc/hosts
#curl testapp.com
4. Run oo-last-access on node, and check the .last_access
#oo-last-access 
#cat 547d183fe5fed55d02000047 
02/Dec/2014:10:07:33 +0800

Comment 5 errata-xmlrpc 2014-12-10 13:25:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2014-1979.html