[jboss-jira] [JBoss JIRA] (WFLY-3560) Combination of HTTP Request Header "Connection:keep-alive" and "Expect:100-conitnue" causes Wildfly undeploy apps

Gary Yang (JIRA) issues at jboss.org
Tue Jul 1 11:16:28 EDT 2014


    [ https://issues.jboss.org/browse/WFLY-3560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981106#comment-12981106 ] 

Gary Yang edited comment on WFLY-3560 at 7/1/14 11:16 AM:
----------------------------------------------------------

I narrowed down the issue. It is not Connection:keep-alive related. It is POST + content body + Expect:100-continue issue.

These will cause Wildfly to throw exception:
curl -X POST -H Content-Type:text/plain -H Expect:100-continue -d 'test' http://localhost:8080/
curl -X POST -H Content-Type:application/json -H Expect:100-continue -d '"name":"joe"' http://localhost:8080/

These will not:
curl -X POST -H Content-Type:text/plain -H Expect:100-continue http://localhost:8080/
curl -X POST -H Expect:100-continue -d 'test' http://localhost:8080/
curl -X POST -H Expect:100-continue http://localhost:8080/

Don't see the problem with PUT actions.


was (Author: gyang2):
I narrowed down the issue. It is not Connection:keep-alive related. It is POST + content body + Expect:100=continue issue.

These will cause Wildfly to throw exception:
curl -X POST -H Content-Type:text/plain -H Expect:100-continue -d 'test' http://localhost:8080/
curl -X POST -H Content-Type:application/json -H Expect:100-continue -d '"name":"joe"' http://localhost:8080/

These will not:
curl -X POST -H Content-Type:text/plain -H Expect:100-continue http://localhost:8080/
curl -X POST -H Expect:100-continue -d 'test' http://localhost:8080/
curl -X POST -H Expect:100-continue http://localhost:8080/

Don't see the problem with PUT actions.

> Combination of HTTP Request Header "Connection:keep-alive" and "Expect:100-conitnue" causes Wildfly undeploy apps
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-3560
>                 URL: https://issues.jboss.org/browse/WFLY-3560
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Web (Undertow)
>    Affects Versions: 8.0.0.Final, 8.1.0.Final
>            Reporter: Gary Yang
>            Assignee: Jason Greene
>
> Issue is described in https://community.jboss.org/thread/242415
> If client uses "Connection:keep-alive" and "Expect:100-continue" in HTTP request header and send multiple requests, Wildfly (including 8.0.0 and 8.1.0) throws following exception:
> {noformat}
> 2014-06-29 11:12:14,721 ERROR [io.undertow.request] (default task-26) Blocking request failed HttpServerExchange{ POST /enterprise/composite/postAndSend}: java.lang.IllegalStateException: UT000004: getResponseChannel() has already been called
>         at io.undertow.server.protocol.http.HttpContinue.createResponseSender(HttpContinue.java:78)
>         at io.undertow.server.handlers.HttpContinueReadHandler$ContinueConduit.read(HttpContinueReadHandler.java:104)
>         at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127) [xnio-api-3.2.0.Final.jar:3.2.0.Final]
>         at io.undertow.channels.DetachableStreamSourceChannel.read(DetachableStreamSourceChannel.java:181)
>         at io.undertow.server.HttpServerExchange$ReadDispatchChannel.read(HttpServerExchange.java:1897)
>         at org.xnio.channels.Channels.readBlocking(Channels.java:294) [xnio-api-3.2.0.Final.jar:3.2.0.Final]
>         at io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:138)
>         at io.undertow.servlet.spec.ServletInputStreamImpl.close(ServletInputStreamImpl.java:218)
>         at io.undertow.servlet.spec.HttpServletRequestImpl.closeAndDrainRequest(HttpServletRequestImpl.java:589)
>         at io.undertow.servlet.core.ServletBlockingHttpExchange.close(ServletBlockingHttpExchange.java:69)
>         at io.undertow.server.HttpServerExchange.endExchange(HttpServerExchange.java:1363)
>         at io.undertow.server.Connectors.executeRootHandler(Connectors.java:183)
>         at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
>         at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]
> {noformat}
>  
> If there are multiple users sending this kind of requests, Wildfly eventually undeploy all applications.
> Here is a test code using Apache HTTP client
> {code:java}
> 			HttpPost request = new HttpPost(serverURL);
> 			for (int i=0; i<200; i++) { 
> 				StringEntity input = new StringEntity (payLoad);
> 				input.setContentType("application/json");
> 				request.setHeader("Connection", "keep-alive");
> 				request.setHeader("Expect", "100-continue");
> 				request.setEntity(input);
> 				HttpResponse response = httpclient.execute(request);
> 				HttpEntity entity = response.getEntity();
> 	
> 				if (entity != null) {
> 					System.out.println("Response content length: " + entity.getContentLength());
> 				}
> 				EntityUtils.consume(entity);
> 	
> 				if (entity != null) {
> 					System.out.println("Response content length: " + entity.getContentLength());
> 				}
> 				EntityUtils.consume(entity);
> 			}
> {code}



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jboss-jira mailing list