United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-5045306 : Http keep-alive implementation is not efficient

Details
Type:
Bug
Submit Date:
2004-05-11
Status:
Resolved
Updated Date:
2005-09-16
Project Name:
JDK
Resolved Date:
2005-09-16
Component:
core-libs
OS:
generic,windows_xp
Sub-Component:
java.net
CPU:
x86,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.1,5.0
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
Current http keep-alive implementation requires user code to clean up pending data before it can be reused. it is too much burden on programmers.

Also see #5039967


###@###.### 2004-05-11

Cut & paste from email discussions about the root cause for 5039967:

Zhengyu Gu wrote: 

"When plugin download jars, it wraps input stream with JarInputStream, even plugin iterators all jar etnries and reads all entry content, it seems that input stream is still not clean. The solution is to empty the input stream  if iterating jar entries.

I realized that your fix was not enough for plugin, I was hoping that networking code could provide simple call to cleanup the channel. For example, if user code call InputStream.close() && keep-alive is on, then close() call should put into pool, and when the connection is retrieved from the pool, cleanup code will be executed to clean up the pending data and connection become resuable."

                                    

Comments
EVALUATION

Implemented an async cleanup of unread data from the underlying socket. This is configurable through the network properties http.KeepAlive.remainingData and http.KeepAlive.queuedConnections in net.properties.
                                     
2005-09-12
EVALUATION

yingxian wang wrote:

"So this bug is really different from the one that Neal @ NSA reported.

InputStream.close() will only try to reuse the connection if all response body has arrived. Otherwise, we wouldn't try to reuse the connection. This is definitely something that we can look into to improve in a future release."

Not clear whether this is a plugin or java.net bug. Check 4814794
Will try to fix in mustang
###@###.### 2005-06-15 15:44:56 GMT
                                     
2005-06-15



Hardware and Software, Engineered to Work Together