Bug 1058424

Summary: [GSS] (6.4.x) JBossWeb does not close connection and also does not disable keep-alive when "Connection: close" specified in response header
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Masafumi Miura <mmiura>
Component: WebAssignee: Rémy Maucherat <rmaucher>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Cada <mcada>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: mmiura, pslavice
Target Milestone: DR1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 1138672    
Bug Blocks:    
Attachments:
Description Flags
potential patch / jbossweb-connection-close.patch mmiura: review?

Description Masafumi Miura 2014-01-27 18:41:42 UTC
### Description of problem:

JBoss does not check "Connection: close" in response header. It should be checked and JBoss is better to disable keep-alive and close connection when  "Connection: close" exists in response header.


### Steps to Reproduce:

Access JSP or Servlet application, which set "Connection: close" in response header, running on JBoss. For example, calling response.setHeader("Connection","close"); in JSP.


### Actual results:

JBoss does not send FIN packet and the connection is still opened (keep-alived) after response is completed. 


### Expected results:

JBoss sends FIN packet and the connection is closed from JBoss after response is completed.


### Additional info:

Apache httpd and Jetty send FIN packet and the connection is closed from the servers when "Connection: close" header is specified in response. In addition, as far as I heard from the customer, Weblogic also does.

HTTP/1.1 RFC2616 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10) states the following:

~~~
14.10 Connection

HTTP/1.1 defines the "close" connection option for the sender to signal that the connection will be closed after completion of the response. 
~~~

Comment 3 Martin Velas 2014-08-07 14:20:50 UTC
Issue is still valid for EAP 6.3.0.ER10 bits. Also the patch in the attachment is not presented in relevant JBossWeb 7.4.8.Final.

Comment 4 Rémy Maucherat 2014-09-01 13:38:35 UTC
Included in web with r2497, the system property is org.apache.coyote.http11.DEFAULT_DISABLE_UPLOAD_TIMEOUT

Comment 5 Rémy Maucherat 2014-09-01 13:39:08 UTC
Actually, org.apache.coyote.http11.DISABLE_KEEPALIVE_ON_CONCLOSE ...

Comment 6 Kabir Khan 2014-09-08 11:54:39 UTC
Fixed by component upgrade to JBoss Web 7.5.0.Beta1: https://bugzilla.redhat.com/show_bug.cgi?id=1138672

Comment 7 Radim Hatlapatka 2014-09-19 08:31:30 UTC
Verified with EAP 6.4.0.DR1.1 that based on system property org.apache.coyote.http11.DEFAULT_DISABLE_UPLOAD_TIMEOUT 
the connection is closed by sending FIN packet with org.apache.coyote.http11.DEFAULT_DISABLE_UPLOAD_TIMEOUT=true and with org.apache.coyote.http11.DEFAULT_DISABLE_UPLOAD_TIMEOUT=false it remains open.

Comment 10 Radim Hatlapatka 2014-09-19 08:46:02 UTC
Actually I meant org.apache.coyote.http11.DISABLE_KEEPALIVE_ON_CONCLOSE, thanks Masafumi for noticing.