|
Re: Connection timeout, then the transport stays "in error": msg#00033network.samba.java
On Tue, 15 Nov 2005 15:19:53 +0800 Tom Shaw <tomisfaraway@xxxxxxxxx> wrote: > Hi folks > > We've been running into a problem with jCIFS where a connect() times > out, and then every subsequent attempt to connect to that particular > server fails. > > Our application is trying to call listFiles() on a SmbFile directory. > > It's possible that the initial exception is reasonable, because we > only find it happening to one of our servers which is 1000km away, so > packet loss may be occurring. The main problem though is that once the > initial error has occured, jCIFS can't recover from the situation. > > The initial exception is: > jcifs.smb.SmbException: > jcifs.util.transport.TransportException: Transport2 timedout waiting > for response to > SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=false,errorCode=0 > > Then whenever the application attempts to talk to that server again, > we get this exception. As far as I can tell, the exception means "this > transport is in error, and this is what caused it (Connection > timeout)": > > jcifs.smb.SmbException: > jcifs.util.transport.TransportException: Connection in error > jcifs.util.transport.TransportException: Connection timeout > at jcifs.util.transport.Transport.connect(Transport.java:175) > at jcifs.smb.SmbTransport.connect(SmbTransport.java:271) > > So is this a jCIFS bug or should our application be somehow detecting > the error and closing/resetting the transport when there's an error in > connecting? The way this is supposed to work is that if an error occurs the transport is flagged in "error". The next attempt to connect on the transport is returned in error but the transport state is reset to "ground" and the next attempt should be able to try to connect again. But I think I see a problem. The state is only reset if the transport's disconnect method is call but I'm not sure this happends if the transport never actually connects successfully. A simple solution is to also reset the state at the top of jcifs/util/transport/Transport.connect where it returns "Connection in error". Are you comfortable with modifying the package and trying that? Mike |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Logging: 00033, Michael B Allen |
|---|---|
| Next by Date: | Re: help: 00033, Christopher R. Hertel |
| Previous by Thread: | Connection timeout, then the transport stays "in error"i: 00033, Tom Shaw |
| Next by Thread: | help: 00033, Ravi Thota |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |