[jcifs] CLOSE_WAIT-Connections left

Martin martin at heddergott.org
Mon Jun 19 20:02:27 GMT 2006


this is a stacktrace when the socket is left in close_wait-state.
Perhaps this can help to find a solution (call socket.close() when the
exception is thrown ?).

jcifs.smb.SmbException: EOF during NetBIOS session request
        at jcifs.smb.SmbTransport.ssn139(SmbTransport.java:190)
        at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:236)
        at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:301)
        at jcifs.util.transport.Transport.run(Transport.java:223)
        at java.lang.Thread.run(Unknown Source)

        at jcifs.util.transport.Transport.run(Transport.java:239)
        at java.lang.Thread.run(Unknown Source)

        at jcifs.smb.SmbTransport.connect(SmbTransport.java:288)
        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:132)
        at jcifs.smb.SmbFile.connect(SmbFile.java:791)
        at jcifs.smb.SmbFile.connect0(SmbFile.java:761)
        at jcifs.smb.SmbFile.send(SmbFile.java:660)
        at jcifs.smb.SmbFile.doNetEnum(SmbFile.java:1636)
        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1585)
        at jcifs.smb.SmbFile.listFiles(SmbFile.java:1551)
        at CrawlerThread.run(CrawlerThread.java:34)

If it works as designed i would take the source and insert a close() for
me - are there any side effects to expect ?


Michael B Allen schrieb:
> On Fri, 16 Jun 2006 14:50:52 +0200
> Martin <martin at heddergott.org> wrote:
>>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.
> The reason your seeing so many is because you're just creating so many
> sockets in a brief period.
>>I did not found any method to force jcifs to close the connection
>>completely. Are there any methods to close a connection manually or
>>after a certain couple of seconds? Calling the close-Method with
>>reflection did not work.
> 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.
> Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.samba.org/archive/jcifs/attachments/20060619/c40bd8c6/signature.bin

More information about the jcifs mailing list