[jcifs] Multiple host SMB Crawler

Michael B.Allen Michael_B_Allen at ml.com
Fri Apr 11 12:57:19 EST 2003


On Thu, 10 Apr 2003 21:49:04 -0400
"Dan Dumont" <Dan at canofsleep.com> wrote:

> Those exceptions at the beginning should be happenening all at once...   3
> are started at the same time, they should throw at the same time.
> 
> They don't.   

True. This is an interesting observation actually. What's happening is
that the static MpxControl.maxMpxCount which controls how many requests
the client can handle concurrently is initially 1. After the client
negotiates once that value is set higher based on what is negotiated. But
if you have three threads that all try to negotiate at the same time
when this value is 1 the first will block the others bacause mpxCount >=
maxMpxCount. So this will only happen when the client is used for the
first time and several threads are trying to negotiate. After it has
negotiated with a server once maxMpxCount will be higer and multiple
threads will be permitted to proceed.

This is actually a bug because that value should not be static. But it's
not an urgent one so I'm going to wait for something more important to
come up before I fix it. I might just leave it in favor of rewriting
the transport layer with something simpler (if I can think of something
simpler). For now I think you can safely set the initial maxMpxCount to
say 10 if you like (SmbTransport.java:745).

Mike

> -----Original Message-----
> Allen, Michael B (RSCH)
> Sent: Thursday, April 10, 2003 9:44 PM
> 
> With a mixture of real and bogus IP's this is what I get. Looks right to me.
> If I
> add routeable but non-responding hosts it takes much longer because of the
> Connection timeout exceptions but it finishes eventually and still does what
> I
> expect. What do you expect to happen?
> 
> Mike
> 
> $ java -Djcifs.properties=../miallen.prp Overseer
> ###Trying 10.0.0.8
> ###Trying 10.0.0.6
> ###Trying 10.0.0.4
> 
> jcifs.smb.SmbException: No route to host 
>         at jcifs.smb.SmbTransport.send(SmbTransport.java:476)
>         at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:664)
>         at jcifs.smb.SmbTree.treeConnect(SmbTree.java:116)
>         at jcifs.smb.SmbFile.connect(SmbFile.java:514)
>         at jcifs.smb.SmbFile.connect0(SmbFile.java:484)
>         at jcifs.smb.SmbFile.sendTransaction(SmbFile.java:460)
>         at jcifs.smb.SmbFile.listFiles(SmbFile.java:1325)
>         at jcifs.smb.SmbFile.listFiles(SmbFile.java:1237)
>         at Overseer$Hostthread.StartScanning(Overseer.java:26)
>         at Overseer$Hostthread.run(Overseer.java:18)
> ###Trying 10.0.0.2
> 
> jcifs.smb.SmbException: No route to host 
>         at jcifs.smb.SmbTransport.send(SmbTransport.java:476)
>         at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:664)
>         at jcifs.smb.SmbTree.treeConnect(SmbTree.java:116)
>         at jcifs.smb.SmbFile.connect(SmbFile.java:514)
>         at jcifs.smb.SmbFile.connect0(SmbFile.java:484)
>         at jcifs.smb.SmbFile.sendTransaction(SmbFile.java:460)
>         at jcifs.smb.SmbFile.listFiles(SmbFile.java:1325)
>         at jcifs.smb.SmbFile.listFiles(SmbFile.java:1237)
>         at Overseer$Hostthread.StartScanning(Overseer.java:26)
>         at Overseer$Hostthread.run(Overseer.java:18)
> ###Trying 10.0.0.1
> 
> jcifs.smb.SmbException: No route to host 
>         at jcifs.smb.SmbTransport.send(SmbTransport.java:476)
>         at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:664)
>         at jcifs.smb.SmbTree.treeConnect(SmbTree.java:116)
>         at jcifs.smb.SmbFile.connect(SmbFile.java:514)
>         at jcifs.smb.SmbFile.connect0(SmbFile.java:484)
>         at jcifs.smb.SmbFile.sendTransaction(SmbFile.java:460)
>         at jcifs.smb.SmbFile.listFiles(SmbFile.java:1325)
>         at jcifs.smb.SmbFile.listFiles(SmbFile.java:1237)
>         at Overseer$Hostthread.StartScanning(Overseer.java:26)
>         at Overseer$Hostthread.run(Overseer.java:18)
<snip>



More information about the jcifs mailing list