tomcat port annoyance: TIME_WAIT

Thufir hawat.thufir at gmail.com
Wed Mar 4 10:01:22 UTC 2009


On Mon, 02 Mar 2009 13:45:55 -0700, Smoot Carl-Mitchell wrote:

> On Mon, 2009-03-02 at 11:22 +0000, Thufir wrote:
>> Originally posted to tomcat:
>> http://article.gmane.org/gmane.comp.jakarta.tomcat.user/178881
>> 
>> 
>> All too often I find myself waiting for this:
>> 
>> thufir at arrakis:~$
>> thufir at arrakis:~$ netstat -tan | grep 127 tcp        0      0
>> 127.0.0.1:631           0.0.0.0:* LISTEN
>> tcp6       0      0 127.0.0.1:8005          :::* LISTEN
>> tcp6       0      0 127.0.0.1:8080          127.0.0.1:36471 TIME_WAIT
>> tcp6       0      0 127.0.0.1:36466         127.0.0.1:8080 TIME_WAIT
>> tcp6       0      0 127.0.0.1:36467         127.0.0.1:8080 TIME_WAIT
>> tcp6       0      0 127.0.0.1:36469         127.0.0.1:8080 TIME_WAIT
>> tcp6       0      0 127.0.0.1:36470         127.0.0.1:8080 TIME_WAIT
>> tcp6       0      0 127.0.0.1:36468         127.0.0.1:8080 TIME_WAIT
>> thufir at arrakis:~$
>> 
>> 
>> to change to this:
>> 
>> thufir at arrakis:~$ netstat -tan | grep 127 tcp        0      0
>> 127.0.0.1:631           0.0.0.0:* LISTEN
>> tcp6       0      0 127.0.0.1:8005          :::* LISTEN
> 
> TIME_WAIT should not cause a delay in connecting to the listening port.
> A TCP connection in that state is waiting an engineered time period to
> release the connection, so the connection address does not get reused
> and end up receiving packets from the previous connection.  There must
> be something else going on with your Tomcat configuration.



Now I'm getting:

thufir at arrakis:~$ 
thufir at arrakis:~$ netstat -tan | grep 127
tcp        0      0 127.0.0.1:631           0.0.0.0:*               
LISTEN     
tcp        0      0 127.0.0.1:48070         127.0.0.1:8080          
ESTABLISHED
tcp6       0      0 127.0.0.1:8006          :::*                    
LISTEN     
tcp6       1      0 127.0.0.1:8080          127.0.0.1:48066         
CLOSE_WAIT 
tcp6       1      0 127.0.0.1:8080          127.0.0.1:33316         
CLOSE_WAIT 
tcp6       0      0 127.0.0.1:8080          127.0.0.1:48070         
ESTABLISHED
tcp6       0      0 127.0.0.1:8080          127.0.0.1:48067         
CLOSE_WAIT 
tcp6       1      0 127.0.0.1:8080          127.0.0.1:52471         
CLOSE_WAIT 
thufir at arrakis:~$ 



I don't think that it's tomcat per se.  I think it's netbeans weirdness, 
or something to do with my webapp.  However, is there some way clear that 
out, in any event, so that the ports are free?  It's quite a hassle.  I'm 
going to have to reboot for port 8080 being in use, I think.  I can't get 
into tomcat manager and the netbeans deployment fails.



-Thufir





More information about the ubuntu-users mailing list