Bug 995116

Summary: WebSocket request does not wake up idle cartridge
Product: OpenShift Online Reporter: Karel Piwko <kpiwko>
Component: ContainersAssignee: Mrunal Patel <mpatel>
Status: CLOSED UPSTREAM QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.xCC: jhonce, matzew, pmorie
Target Milestone: ---Keywords: UpcomingRelease
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-27 16:29:00 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:

Description Karel Piwko 2013-08-08 14:54:39 UTC
Description of problem:

If a gear is idle, request on WebSocket port don't wake it up.


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

OpenShift Online devenv, based on ami-de96d1b7 - devenv_3628

How reproducible:

Always.

Steps to Reproduce:
1. Create a devenv OpenShift Online instance
2. Create a new app using Aerogear cartridge

   rhc create-app pushserver https://raw.github.com/fjuma/origin-server/downloadable/cartridges/openshift-origin-cartridge-aerogear-push/metadata/manifest.yml mysql-5.1  

3. Put cartridge idle

   /usr/sbin/oo-admin-ctl-gears idlegear uuid   

4. Ensure cartridge is idle
 
   /usr/sbin/oo-idler-stats


5. Fire request to SimplePush (netty on :8000 -> :8676 port), for instance to an endpoint or directly to /simplepush

curl -i --header "Content-Type:application/x-www-form-urlencoded" -X PUT -d "version=2" http://pushserver-aerogear.dev.rhcloud.com:8000/endpoint/470dddc2-ce0b-4306-8be3-eaf995218


Actual results:

HTTP 503, cartridge is still idle, you can repeat as many times as you want

Expected results:

HTTP 302, the same for :80 HTTP requests or directly HTTP 200

Additional info:

If I wake up gear with request to :80, it gives me back HTTP 302, subsequent requests return HTTP 200.

Comment 1 matzew 2013-08-12 14:39:55 UTC
Is it possible, that the HTTP UPGRADE is not understood ?

Comment 2 Mrunal Patel 2013-08-12 15:41:39 UTC
This is something that hasn't been implemented. The code will detect that websocket request was made and not try to idle it however it won't wake up idled app when accessed through 8000/8443. The workaround to restore it is to access it through regular port.

Comment 3 matzew 2013-08-13 08:26:39 UTC
Using the default ports is not an option, using our Cartridge

Comment 4 Mrunal Patel 2013-08-14 04:57:12 UTC
I have added this card to add restorer functionality to websocket proxy
https://trello.com/c/3qaFOcIE/232-implement-restorer-for-websocket-requests

Comment 5 Jhon Honce 2013-08-27 16:29:00 UTC
Track progress here https://trello.com/c/3qaFOcIE/232-5-implement-restorer-for-websocket-requests