[jboss-jira] [JBoss JIRA] Commented: (JBAS-6814) Chuncked encoding HTTP POST request against servlet causes 100% CPU usage
Remy Maucherat (JIRA)
jira-events at lists.jboss.org
Tue Apr 21 13:17:22 EDT 2009
[ https://jira.jboss.org/jira/browse/JBAS-6814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12463499#action_12463499 ]
Remy Maucherat commented on JBAS-6814:
--------------------------------------
The Servlet code is wrong, you should not "request" chunking, and actually all the operations done there are simply wrong and inefficient. Lines which need to be removed are marked with ">".
response.setHeader("JSESSIONID", session.getId());
response.setHeader("Content-Type", "application/octet-stream");
> response.setContentLength(-1);
> response.addHeader("Transfer-Encoding","chunked");
response.setStatus(HttpServletResponse.SC_OK);
ServletOutputStream sos = response.getOutputStream();
> sos.flush();
int num = 125;
byte somebytes[] = new byte[num];
for ( int i = 0; i < num; i++ ) {
somebytes[i] = (byte)i;
}
sos.write(somebytes);
> sos.flush();
System.err.println("---------------finish");
} catch (IOException e) {
e.printStackTrace();
} finally {
> try {
> request.getInputStream().close();
> response.getOutputStream().close();
> } catch (IOException e) {
> e.printStackTrace();
> }
}
Beyond that, I suppose you are saying that some chunked input causes an issue, this should be looked into.
> Chuncked encoding HTTP POST request against servlet causes 100% CPU usage
> -------------------------------------------------------------------------
>
> Key: JBAS-6814
> URL: https://jira.jboss.org/jira/browse/JBAS-6814
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Web (Tomcat) service
> Affects Versions: JBossAS-5.1.0.CR1
> Reporter: Howard Gao
> Assignee: Remy Maucherat
> Priority: Critical
> Fix For: JBossAS-5.1.0.GA
>
> Attachments: httpunit-post.zip, servlet-src.zip, test-servlet.war.zip
>
>
> HTTP POST request of chunked encoding type causes the CPU in 100% usage.
> JBoss Remoting 2.0 need this to be fixed to be able to support servlet transport.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list