[jgroups-dev] org.jgroups.protocols.UDP - failed sending message to null
David Alves <[email protected]> Thu, 23 Dec 2010 16:15:41 +0000
| Newsgroups | gmane.comp.java.javagroups.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi
I'm seeing the exact same problem (using jgroups 2.11.0 GA).
It took me a while to get to the actual exception (since the failed message error log is not very forthcoming), but I'm getting the Invalid Argument IOException.
I'm on mac OSX (snow leopard).
Here's some additional context:
I'm using JGroups as a discovery service and cluster membership fw (discovery by UDP mcast so far).
Initially JGroups behaves well, discovery works and initial state negotiation completes.
The thing is that my app also uses Zookeeper and when Zookeeper starts jgroups starts failing with the error message I mentioned.
I've set the prefer Ipv4 sysprop.
Any ideas as to why this is happening and what can I do to solve the problem?
Thanks
David
PS: I know this message probably should go on the user mailing list but the original one was already here so...
--- Original Message ----
It is not an InterruptedIOException. Not sure how to reproduce it, It
doesn't happen all the time. This week I was lucky to catch it under my
IDE so I can provide more information.
This is where the exception is caught:
/try {
send(msg, dest, multicast);
}
catch(InterruptedIOException iex) {
;
}
catch(InterruptedException interruptedEx) {
Thread.currentThread().interrupt(); // let someone else
handle the interrupt
}
catch(Throwable e) {
if(log.isErrorEnabled()) {
log.error("failed sending message to " + dest + " (" +
msg.size() + " bytes): " + e); <--- here
}
}
return null;/
Using break points I was able to catch the culprit, its UDP._send
/private void _send(InetAddress dest, int port, boolean mcast, byte[]
data, int offset, int length) throws Exception {
DatagramPacket packet=new DatagramPacket(data, offset, length,
dest, port);
try {
if(mcast) {
if(mcast_sock != null && !mcast_sock.isClosed())
mcast_sock.send(packet); <-- This is where it fails
}
else {
if(sock != null && !sock.isClosed())
sock.send(packet);
}
}
catch(Exception ex) {
throw new Exception("dest=" + dest + ":" + port + " (" +
length + " bytes)", ex);
}
}/
So it seems like a Java/Linux kernel(based on some posts on the
internet) problem but it is hard to debug since there is no stack trace.
Maybe a configurable flag to trigger an exception with/without stack
trace would be beneficial.
Thanks.
On 12/18/2010 09:00 AM, Bela Ban wrote:
> Let's start from scratch: what exactly is the error ? The code in
> Discovery.start() which calls sendGetMembersRequest() catches the
> InterruptedIOException, therefore you shouldn't even see this.
>
> The InvalidArgument IOException is new, how do you arrive at this ?
> How do you reproduce it ?
>
> [1] https://issues.jboss.org/browse/JGRP-1161
>
>
> On 12/16/10 8:37 PM, Adrian Tarau wrote:
>> It's in the ticket, 2.10. I see thread interruption handling so it's not
>> that causing the exception, it's an IOException and it happens on the
>> multicast receiver & timer thread.
>>
>> The error message "Invalid argument" reminds me of failures when I did
>> some experiments with MulticastSocket. After several attempts to track
>> where the exception is thrown it is actually the MulticastSocket, it
>> fails in UDP:
>>
>> /private void _send(InetAddress dest, int port, boolean mcast, byte[]
>> data, int offset, int length) throws Exception {
>> DatagramPacket packet=new DatagramPacket(data, offset, length, dest,
>> port);
>> try {
>> if(mcast) {
>> if(mcast_sock != null && !mcast_sock.isClosed())
>> * mcast_sock.send(packet);*
>> }
>> else {
>> if(sock != null && !sock.isClosed())
>> sock.send(packet);
>> }
>> }
>> catch(Exception ex) {
>> throw new Exception("dest=" + dest + ":" + port + " (" + length + "
>> bytes)", ex);
>> }
>> }
>> /
>> The DatagramPacket buffer has 103 bytes and it tries to send to
>> 228.110.10.10:46553(tried different addresses but it still fails).
>
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Javagroups-development mailing list