[jcifs] CLOSE_WAIT-Connections left

Martin Heddergott martin at heddergott.org
Sat Jun 17 12:31:54 GMT 2006

> On Fri, 16 Jun 2006 14:50:52 +0200
> Martin <martin at heddergott.org> wrote:
>> Hello,
>> we have a small set of unix-scripts (mysql + smbclient) which crawls our
>> local network-shares for Documents and adds them into a database where
>> it can be searched by our users.
>> Now i found jcifs and gave it a try because the scripts are really slow
>> sometimes and i just prefer a JAVA-solution :)
>> Jcifs works pretty good (!!), but after searching for a while, there are
>> much connections in "close_wait" left. This is a problem i think,
>> because it can cause the operating-system to not open new connections
>> right ?
> No, CLOSE_WAIT status is part of the normal life cycle for a TCP
> connection. It has something to do with waiting for an acknowledgement
> that MAY never come and therefore the OS kernel must leave the socket
> state open for a while. It's not entirely clear to me why it should even
> bother but that's just the way it works.

Yeah, i know how TCP works. I thought there is an error in jcifs with
correctly closing the connectinons.

> The reason your seeing so many is because you're just creating so many
> sockets in a brief period.

There is no other way i think :)

> No. JCIFS transport close after jcifs.smb.client.soTimeout milliseconds
> of inactivity.
> You definitely want to reduce soTimeout and possibly some other properties
> like the attribute expiration. Search the list. I've posted about this
> a long time ago. Tweeking properties is REALLY important for crawling.

I'll give this a try. Thank You !

> Mike
> --
> Michael B Allen
> PHP Extension for SSO w/ Windows Group Authorization
> http://www.ioplex.com/

Martin H.

More information about the jcifs mailing list