Bug 1275647 - Proxy templates API breaks on concurrent requests
Proxy templates API breaks on concurrent requests
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Capsule (Show other bugs)
6.0.4
Unspecified Unspecified
unspecified Severity high (vote)
: 6.1.6
: --
Assigned To: Dmitri Dolguikh
Sachin Ghai
http://projects.theforeman.org/issues...
: Triaged
: 1343667 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-27 08:25 EDT by Bryan Kearney
Modified: 2017-02-23 14:44 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A race condition existed on the capsule when generating templates. The proxy was improved to support concurrent releases.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-21 02:42:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test_result with 8443 port (23.77 KB, image/png)
2016-01-18 02:23 EST, Sachin Ghai
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 12319 None None None 2016-04-22 12:34 EDT

  None (edit)
Description Bryan Kearney 2015-10-27 08:25:20 EDT
When trying to render templates concurrently, multiple (different) failures occurs.

Reproducer:

<pre>
#!/bin/bash

proxy_url=$1
token=$2
num_requests=$3

path="${proxy_url}/unattended/iPXE?token=${token}"

for (( i=0; i<$num_requests; i++ ))
do
curl -s $path &
done
</pre>

<pre>
# ./proxy_error_test.sh http://localhost:8448 eb9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6 15

Failed to retrieve iPXE template for {"token"=>"eb9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: stream closedFailed to retrieve iPXE template for {"token"=>"eb9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: stream closedFailed to retrieve iPXE template for {"token"=>"eb9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: undefined method `closed?' for nil:NilClassFailed to retrieve iPXE template for {"token"=>"eb9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: undefined method `closed?' for nil:NilClassFailed to retrieve iPXE template for {"token"=>"eb9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: undefined method `closed?' for nil:NilClassFailed to retrieve iPXE template for {"token"=>"eb9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: undefined method `closed?' for nil:NilClassFailed to retrieve iPXE template for {"token"=>"eb9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: undefined method `closed?' for nil:NilClass
</pre>
Comment 1 Bryan Kearney 2015-10-27 08:25:21 EDT
Created from redmine issue http://projects.theforeman.org/issues/12319
Comment 3 Lukas Zapletal 2015-11-02 04:17:41 EST
I think this should make it in 6.1 z-stream. Upstream merged. Low effort.
Comment 4 Bryan Kearney 2015-11-02 06:02:57 EST
Upstream bug assigned to ddolguik@redhat.com
Comment 5 Bryan Kearney 2015-11-02 06:03:00 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/12319 has been closed
-------------
Anonymous
Applied in changeset commit:26aba8520d3d32ca27b9708cb98169bc31d43d7b.
Comment 11 Sachin Ghai 2016-01-18 02:21:29 EST
I was trying to verify this bz with given script and steps in comment 7 and 8. However, looks like port 8000 is not valid. 

hwoever, with port 8443, I'm getting following output.  

[root@cloud-qe-6 ~]# ./racetest.sh http://localhost:8443 b9d50b5c-23a3-4a66-b4d2-9f18cafc7db9 5
[root@cloud-qe-6 ~]# 





Is this expected result, please confirm ? thanks
Comment 12 Sachin Ghai 2016-01-18 02:23 EST
Created attachment 1115759 [details]
test_result with 8443 port
Comment 13 Sachin Ghai 2016-01-18 02:23:39 EST
Please take a look at attachment.
Comment 14 Lukas Zapletal 2016-01-18 03:56:38 EST
Oh port is the smart proxy port, which is usually 9090, 8448 or 8443 according to your configuration. You must see request logs in proxy.log.
Comment 15 Sachin Ghai 2016-01-18 05:07:32 EST
Thank you Lukas.

Verified with in 6.1.6 compose #5

On concurrent requests, I don't see error reported in original bug request. I tried with 1500 requests concurrently.

[root@cloud-qe-6 ~]# ./racetest.sh http://localhost:9090 b9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6 1500
[root@cloud-qe-6 ~]# ./racetest.sh https://localhost:9090 b9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6 1500
Failed to retrieve iPXE template for {"token"=>"b9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: Error retrieving iPXE for {"token"=>"b9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", :url=>"http://cloud-qe-6.idmqe.lab.eng.bos.redhat.com:8000"} from cloud-qe-6.idmqe.lab.eng.bos.redhat.com: Net::HTTPMethodNotAllowed
:::::
:::::
Failed to retrieve iPXE template for {"token"=>"b9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", "splat"=>[], "captures"=>["iPXE"], "kind"=>"iPXE"}: Error retrieving iPXE for {"token"=>"b9e1d9c-0bd1-4361-a3c2-7e0961a9b5b6", :url=>"http://cloud-qe-6.idmqe.lab.eng.bos.redhat.com:8000"} from cloud-qe-6.idmqe.lab.eng.bos.redhat.com: Net::HTTPMethodNotAllowed
Comment 19 errata-xmlrpc 2016-01-21 02:42:34 EST
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://access.redhat.com/errata/RHBA-2016:0052
Comment 20 Pavel Moravec 2016-06-20 06:10:57 EDT
*** Bug 1343667 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.