[jcifs] DFS Links and Timeouts

Michael B Allen mba2000 at ioplex.com
Sat Dec 17 21:47:29 GMT 2005


On Fri, 16 Dec 2005 15:38:30 +0100
"Martin D. Pedersen" <mdp at visanti.com> wrote:

> But jcifs somehow timeouts when accessing files through dfs links. 
> If i traverse the files directly from //secondary/data there is no
> problem!

I *think* I have this fixed. Try the attached patch and let us know how
it goes for you.

Basically the problem is that the member SmbFile.unc (which
is a path relative to the share) is being changed when a
DFS referral occurs. Initially this isn't a problem but after
jcifs.smb.client.attrExpirationPeriod expires SmbFile.unc is used to
construct paths that can be incorrect.

> The reason this is a problem is because I'm implementing a crawler kind
> of process, that needs to process the files. Sometimes for more than
> 16s.
> I realise that I can set jcifs.smb.client.soTimeout=0 and it will solve
> my immediate problem. 

I don't think that would help actually. Actually it would just keep
transports open indefinitely and you would quickly exhaust all memory.

For a crawler you probably want to increase attrExpirationPeriod greatly
though. That in combination with using a tree traversal algorithm that
does not built large lists of nodes that will later become stale will
give you much better results.

Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DfsTimeout.patch
Type: application/octet-stream
Size: 932 bytes
Desc: not available
Url : http://lists.samba.org/archive/jcifs/attachments/20051217/421b7aa6/DfsTimeout.obj


More information about the jcifs mailing list