Re: Question about RMI, TCP/IP KeepAlive, and socket reset exceptions...
Peter Jones - JavaSoft East <[email protected]>
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <20051028231746.GA1833@east> |
> So, I am not a network communications pro -- too much to keep up on,
> but we intermittently receive Marshalling or Unmarshalling
> exceptions usually due to socket resets or broken pipes when we have
> say a couple of hundreds clients communicating with our server. Note
> that we use RMI SSL Socket Factories.
>
> I understand that connections are unreliable and that I cannot
> completely fix this. However, I am wondering what steps I can take
> (tuning or otherwise) to help make this a more rare occurrence.
>
> One thing I noticed is that RMI will use TCP KeepAlive if it is
> available. I also know that problems with KeepAlive messages "could"
> result in unnecessary socket resets. What would happen if in my
> socket factory a made #getKeepAlive always return false and
> #setKeepAlive always call super.setKeepAlive( false ). Would this
> help mitigate seemingly unnecessary reset connection exceptions?
I wouldn't count on it. Are your remote invocations long-running?
Assuming the typical TCP keepalive interval of two hours, disabling
the SO_KEEPALIVE option should only "help" when there is a remote
invocation that executes on the server for a very long time (more than
two hours) and there is a temporary network partition between the
client and the server during that time (when the keepalive would have
occurred and thus reset the connection), but network connectivity is
restored before the invocation completes and the server starts sending
the result.
> Anything else I should try? Reducing the value of RMI connection
> expiration to say 10 seconds so the server is not managing as many
> connections? (and hopefully will not choose to reset existing
> connections?) Other things I am missing?
Are you sure that the apparent communication failures are not caused
by the following issue (obscured server-side unmarshalling failure)?
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4716483
Seeing some complete stack traces might be helpful.
-- Peter
===========================================================================
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