[jcifs] total disk space

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Fri Oct 11 10:51:48 EST 2002


This is a bug in jCIFS. In the current version null is used to indicate the session was
closed. Somehow you've managed to expose a condition were this null condition is not
checked. This will not happen in the next version because null is not used to indicate the
session is closed and the setTree business is gone. Actually the whole thing is quite a bit
more elegant and I think people will find there is a noticeable speed boost.

Also, you have to be very carefull about writing a "crawler" program. The trick is not to
create stale lists. I think that may have been the ultimate source of this error condition. If
you have big stale lists of files the client must resort to querying each file independently
and that will create a huge amount of unnecessary traffic. You should only create lists of
SmbFiles that you can process before the attrExperationPeriod. The trick to doing that is
to associate threads with sub branches to avoid the condition where you list a big
directory and then go off and crawl on some other host and then come back and start
messing with this big stale list of SmbFiles. It will work but it will just take about 100x
longer and flood the network with traffic.

To write a truly effective crawler program is not easy. You'll definitely need to break out the
packet sniffer and devise a method that keeps traffic to a minimum. The T2Crawler was
the closest I ever come and it's still not quite right.

> -----Original Message-----
> From:	Sujit Jagdev [SMTP:sujit.jagdev at casero.com]
> Sent:	Thursday, October 10, 2002 4:14 PM
> To:	Allen, Michael B (RSCH); jcifs at lists.samba.org
> Cc:	Matthew Tippett
> Subject:	RE: [jcifs] total disk space
> 
> 
> Dear All,
> 
> 
> I am attempting to scan our internal network every 10 minutes using a
> thread.
> It seems to work the first couple of times and then results in the
> following exception being thrown each time.
> 
> java.lang.NullPointerException
> 1034280057825 INF 000012c0eca com.casero.eden.service.cifs.CIFSCrawler
> at jcifs.smb.SmbSession.matches(SmbSession.java:78)
> 1034280057825 INF 000022c0eca com.casero.eden.service.cifs.CIFSCrawler
> at jcifs.smb.SmbTransport.getSmbSession(SmbTransport.java:183)
> 1034280057825 INF 000012c0eca com.casero.eden.service.cifs.CIFSCrawler
> at jcifs.smb.SmbFile.setTree(SmbFile.java:479)
> 1034280057825 INF 000012c0eca com.casero.eden.service.cifs.CIFSCrawler
> at jcifs.smb.SmbFile.sendTransaction(SmbFile.java:487)
> 1034280057825 INF 000012c0eca com.casero.eden.service.cifs.CIFSCrawler
> at jcifs.smb.SmbFile.listFiles(SmbFile.java:1195)
> 1034280057825 INF 000012c0eca com.casero.eden.service.cifs.CIFSCrawler
> at jcifs.smb.SmbFile.listFiles(SmbFile.java:1135)
> 1034280057840 INF 000022c0eca com.casero.eden.service.cifs.CIFSCrawler
> at com.casero.eden.service.cifs.CIFSCrawler.scan(CIFSCrawler.java:120)
> 1034280057840 INF 000022c0eca com.casero.eden.service.cifs.CIFSCrawler
> at com.casero.eden.service.cifs.CIFSCrawler.run(CIFSCrawler.java:49)
> 
> Could you please some light as what I am doing wrong.
> Thanks
> Sujit
> 
> 
> -----
> 
> The information contained in this message is proprietary of Casero Inc.,
> protected from disclosure, and may be privileged. The information is
> intended to be conveyed only to the designated recipient(s) of the
> message. If the reader of this message is not the intended recipient,
> you are hereby notified that any dissemination, use, distribution or
> copying of this communication is strictly prohibited and may be
> unlawful. If you have received this communication in error, please
> notify us immediately by replying to the message and deleting it from
> your computer. Thank you.
> 




More information about the jcifs mailing list