[jcifs] socket connection timed out error under load

Michael B Allen mba2000 at ioplex.com
Wed Jul 28 21:49:03 GMT 2004

Jonas Partner said:
> Does that leave us back with the possible synchronization issue ?
> Jonas Partner
> The below is the whole stack
> jcifs.smb.SmbException: An error occured sending the request.
> java.net.ConnectException: Connection timed out: connect
> 	at java.net.PlainSocketImpl.socketConnect(Native Method)
> 	at java.net.PlainSocketImpl.doConnect(Unknown Source)
> 	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
> 	at java.net.PlainSocketImpl.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at jcifs.netbios.NbtSocket.<init>(NbtSocket.java:60)
> 	at jcifs.smb.SmbTransport.ensureOpen(SmbTransport.java:275)
> 	at jcifs.smb.SmbTransport.send(SmbTransport.java:600)

No. I'm increasingly becoming convinced that this is not a synchronization
issue. At least this trace is definately not a synchronization issue
because it dies with "Connection timed out" in the native socket
implementation. This happends with the you try to open a socket to a
routeable address but the initail SYN package is ignored (no ACK). There's
*nothing* jCIFS can do about this. The other trace you posted showed the
natice socket implementation was calling close(). At first I thought
calling close() while calling NbtSocket.ensureOpen() might be a condition
for a synchronization issue but in hindsight that error too is happening
entirely within the native socket code and therefore is out of range of
what jCIFS has an influence over.

I would look at the JVM and the network. Try different VMs (e.g. IBMs).
Try different client machines. The kind of thing that might cause an error
like this would be if your network card was in half-duplex on a
full-duplex network.


PS: I originally claimed your test program was "intense". I was incorrect.
I think I was thinking of something else because it has sleeps() and a
limited number of threads. The T2Crawler would be "intense" and it works
just fine last I checked.

More information about the jcifs mailing list