[jcifs] Re: jCIFS mailing list problems?
Michael B Allen
miallen at ioplex.com
Wed Aug 6 03:15:29 GMT 2008
> > SmbFile.copyTo() hangs in the WriterThread run() method when the
> > destination
> > Samba fileserver is disconnected or restarted (I could always reproduce the
> > problem).
> >
> > The problem is in the last part of the WriterThread run() method, where the
> > check "w.e != null" is performed AFTER the waiting loop for w.ready ...
> > When
> > the destination gets unreachable, w gets never "ready" anymore and we
> > have a
> > deadlock....
<snip>
> >
> > Putting a check for w.e before the w.ready loop solves the problem:
> >
> > i = off = 0;
> > for( ;; ) {
> > req.setParam( fid, off, bsize );
> > resp.setParam( b[i], 0 );
> > send( req, resp );
> > synchronized( w ) {
> > // Patch by A.Smulders for avoiding
> > // hang on Samba server disconnection
> > if( w.e != null ) {
> > throw w.e;
> > }
> >
> > while( !w.ready ) {
> > try {
> > w.wait();
> > } catch( InterruptedException ie ) {
> > throw new SmbException( dest.url.toString(), ie );
Hi Alberto,
Applied in my local copy. It should make it into the next release.
I have not gone through the trouble to reproduce this on my end so I don't know if this is really the optimal fix for this issue. But it seems sturdy and should a fairly benign change so I'll apply it blind.
Thanks,
Mike
--
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/
More information about the jcifs
mailing list