You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2016/07/16 17:40:09 UTC

[Bug 59869] New: mod_proxy failonstatus option is broken since 2.4.17 on Solaris 10

https://bz.apache.org/bugzilla/show_bug.cgi?id=59869

            Bug ID: 59869
           Summary: mod_proxy failonstatus option is broken since 2.4.17
                    on Solaris 10
           Product: Apache httpd-2
           Version: 2.4.23
          Hardware: All
                OS: Solaris
            Status: NEW
          Severity: regression
          Priority: P2
         Component: mod_proxy
          Assignee: bugs@httpd.apache.org
          Reporter: n.akhnin@ftc.ru

Configuration:
<Proxy "balancer://cluster">
  BalancerMember "http://localhost:17293/webapp" route=node1 retry=10 ping=1
connectiontimeout=1
  BalancerMember "http://localhost:17294/webapp" route=node2 retry=10 ping=1
connectiontimeout=1
</Proxy>

ProxyPass / "balancer://cluster/" stickysession=JSESSIONID|jsessionid
failonstatus=502,503

For 2.4.16 and later versions, when backend node returns 503, Apache forces it
into error state.
Since 2.4.17 till 2.4.23, when 503 returned, nothing happens, node status is OK
and Apache keep on proxying requests on this node

This behavior is reproduced both on Sparc machine and x86 VirtualBox VM

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 59869] mod_proxy failonstatus option is broken since 2.4.17 on Solaris 10

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59869

Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34050|0                           |1
        is obsolete|                            |

--- Comment #2 from Ruediger Pluem <rp...@apache.org> ---
Created attachment 34051
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34051&action=edit
Patch against trunk

Fix logical error in if confdition:

Index: modules/proxy/mod_proxy.c
===================================================================
--- modules/proxy/mod_proxy.c   (revision 1753164)
+++ modules/proxy/mod_proxy.c   (working copy)
@@ -1273,17 +1273,25 @@
      * the error page on the proxy or if the error was not generated by the
      * backend itself but by the proxy e.g. a bad gateway) in order to give
      * ap_proxy_post_request a chance to act correctly on the status code.
+     * But only do the above if access_status is not OK and not DONE, because
+     * in this case r->status might contain the true status and overwriting
+     * it with OK or DONE would be wrong.
      */
-    saved_status = r->status;
-    r->status = access_status;
-    ap_proxy_post_request(worker, balancer, r, conf);
-    /*
-     * Only restore r->status if it has not been changed by
-     * ap_proxy_post_request as we assume that this change was intentional.
-     */
-    if (r->status == access_status) {
-        r->status = saved_status;
+    if ((access_status != OK) && (access_status != DONE)) {
+        saved_status = r->status;
+        r->status = access_status;
+        ap_proxy_post_request(worker, balancer, r, conf);
+        /*
+         * Only restore r->status if it has not been changed by
+         * ap_proxy_post_request as we assume that this change was
intentional.
+         */
+        if (r->status == access_status) {
+            r->status = saved_status;
+        }
     }
+    else {
+        ap_proxy_post_request(worker, balancer, r, conf);
+    }

     proxy_run_request_status(&access_status, r);
     AP_PROXY_RUN_FINISHED(r, attempts, access_status);

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 59869] mod_proxy failonstatus option is broken since 2.4.17 on Solaris 10

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59869

--- Comment #5 from Ruediger Pluem <rp...@apache.org> ---
Proposed for backport to 2.4.x as r1754075.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 59869] mod_proxy failonstatus option is broken since 2.4.17 on Solaris 10

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59869

Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk,
                   |                            |PatchAvailable

--- Comment #4 from Ruediger Pluem <rp...@apache.org> ---
Committed to trunk as r1753592. Backport proposal for 2.4.x will follow in a
few days.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 59869] mod_proxy failonstatus option is broken since 2.4.17 on Solaris 10

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59869

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Yann Ylavic <yl...@gmail.com> ---
Backported to 2.4.24 in r1756562.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 59869] mod_proxy failonstatus option is broken since 2.4.17 on Solaris 10

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59869

--- Comment #1 from Ruediger Pluem <rp...@apache.org> ---
Created attachment 34050
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34050&action=edit
Patch against trunk

Does the attached patch against trunk (applies to 2.4.x with offset) fix your
problem?

Index: modules/proxy/mod_proxy.c
===================================================================
--- modules/proxy/mod_proxy.c   (revision 1753164)
+++ modules/proxy/mod_proxy.c   (working copy)
@@ -1273,17 +1273,25 @@
      * the error page on the proxy or if the error was not generated by the
      * backend itself but by the proxy e.g. a bad gateway) in order to give
      * ap_proxy_post_request a chance to act correctly on the status code.
+     * But only do the above if access_status is not OK or DONE, because
+     * in this case r->status might contain the true status and overwriting
+     * it with OK or DONE would be wrong.
      */
-    saved_status = r->status;
-    r->status = access_status;
-    ap_proxy_post_request(worker, balancer, r, conf);
-    /*
-     * Only restore r->status if it has not been changed by
-     * ap_proxy_post_request as we assume that this change was intentional.
-     */
-    if (r->status == access_status) {
-        r->status = saved_status;
+    if ((access_status != OK) || (access_status != DONE)) {
+        saved_status = r->status;
+        r->status = access_status;
+        ap_proxy_post_request(worker, balancer, r, conf);
+        /*
+         * Only restore r->status if it has not been changed by
+         * ap_proxy_post_request as we assume that this change was
intentional.
+         */
+        if (r->status == access_status) {
+            r->status = saved_status;
+        }
     }
+    else {
+        ap_proxy_post_request(worker, balancer, r, conf);
+    }

     proxy_run_request_status(&access_status, r);
     AP_PROXY_RUN_FINISHED(r, attempts, access_status);

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 59869] mod_proxy failonstatus option is broken since 2.4.17 on Solaris 10

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59869

--- Comment #3 from Nikita Akhnin <n....@ftc.ru> ---
Yes, the problem is fixed.

Can I expect that this patch will be included in the next release?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org