Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366153 - CPU rise and never going down.
Summary: CPU rise and never going down.
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 04:06 EST by chenchuanfeng CLA
Modified: 2011-12-09 18:33 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chenchuanfeng CLA 2011-12-09 04:06:03 EST
Build Identifier: 9.0-20110318

I write a servet and deploy it to the jetty server(version:jetty-distribution-8.0.0.v20110901).
when I access this servlet,the cpu rise to a high level and never going down.
The servlet source is:
public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		PrintWriter out = response.getWriter();
	        response.addHeader("Content-Length", "3");
		out.println("abcde");
		out.flush();
		out.close();
} 
This issue would happen when I use println() method and the Content-Length value is less than the real bytes printed.


Reproducible: Always

Steps to Reproduce:
1.write a servlet using the code above
2.deploy the web project to jetty
3.using browser to access this servlet
Comment 1 Jan Bartel CLA 2011-12-09 18:33:01 EST
Hi,

I tested this against the latest release of jetty-8, which is 8.1.0.RC1 and this does not occur (any more). The HttpOutput.write method checks to see if the amount that is written is equal to the content length and closes if so, so it won't try and write more than that amount of data.

regards
Jan