Re: Software Caused Connection Abort (10053) on Client
Robert DiFalco <[email protected]> Fri, 2 Dec 2005 15:10:19 -0800
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <[email protected]> |
Hmmm...but with a default SSL/RMI Socket factory, is it possible that
the server would have invoked the call before the client had flushed the
output stream? I was thinking of something very hacky like this:
private boolean shouldRetryOn( final Throwable e )
{
if ( e instanceof UnmarshalException )
{
if ( e.getMessage().indexOf( "return header" ) == -1 )
return false;
StringWriter swriter = new StringWriter();
PrintWriter pwriter = new PrintWriter( swriter );
e.printStackTrace( pwriter );
return swriter.getBuffer().indexOf(
"releaseOutputStream" ) != -1;
}
return ( e instanceof NoSuchObjectException || e instanceof
MarshalException );
}
I guess the risk here is that releaseOutputStream could exception after
enough bytes had been flushed to already invoke the call on the server
side. So it seems for this one case (UnmarshalException) there is no
resolution/workaround. Or am I giving up to quickly? :)
R.
-----Original Message-----
From: Bob Scheifler [mailto:[email protected]]
Sent: Friday, December 02, 2005 2:19 PM
To: Robert DiFalco
Cc: [email protected]
Subject: Re: Software Caused Connection Abort (10053) on Client
> I think you can also get Unmarshal exceptions as well as Marshal.
Yes, you can.
> I suppose we can add to our #shouldReload logic a check to see if it
> is an "unmarshaling return header" exception with "socketWrite" in the
> stack trace. That way we won't rerun remote methods that actually ran
> on the server but just had a problem unmarshaling result values from
> the remote call.
Nope, even with "unmarshaling return header" the upcall may have been
executed on the server side. UnmarshalExceptions really aren't safe
unless your remote calls are idempotent.
- Bob
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html
To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html