You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "Mubarak Seyed (JIRA)" <ji...@apache.org> on 2012/06/22 00:41:42 UTC

[jira] [Created] (FLUME-1306) LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one

Mubarak Seyed created FLUME-1306:
------------------------------------

             Summary: LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one
                 Key: FLUME-1306
                 URL: https://issues.apache.org/jira/browse/FLUME-1306
             Project: Flume
          Issue Type: Bug
            Reporter: Mubarak Seyed
            Assignee: Mubarak Seyed


It appears from test that if we provide invalid host address as one of the host address in the host list, {{LoadBalancingRpcClient}} should catch exception for invalid {{RpcClient}} and failover to next in the host list.

{code}
ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
java.io.IOException: Error connecting to xxxxx-xxxxx.xxxx.xxxxx.xxxx:xxxx
        at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
        at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
        at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
        at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
        at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
        at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
        at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
        at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
        at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
        at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
{code}

The proposed fix would be moving {{RpcClient client = getClient(host)}} inside {{try}} block

{code}
@Override
  public void append(Event event) throws EventDeliveryException {
    boolean eventSent = false;
    Iterator<HostInfo> it = selector.createHostIterator();

    while (it.hasNext()) {
      HostInfo host = it.next();
      try {
        RpcClient client = getClient(host);
        client.append(event);
        eventSent = true;
        break;
      } catch (Exception ex) {
        LOGGER.warn("Failed to send event to host " + host, ex);
      }
    }

    if (!eventSent) {
      throw new EventDeliveryException("Unable to send event to any host");
    }
  }
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FLUME-1306) LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLUME-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402638#comment-13402638 ] 

Hudson commented on FLUME-1306:
-------------------------------

Integrated in flume-trunk #261 (See [https://builds.apache.org/job/flume-trunk/261/])
    FLUME-1306. LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one.

(Mubarak Seyed via Hari Shreedharan) (Revision 1354263)

     Result = UNSTABLE
hshreedharan : http://svn.apache.org/viewvc/?view=rev&rev=1354263
Files : 
* /incubator/flume/trunk/flume-ng-sdk/src/main/java/org/apache/flume/api/LoadBalancingRpcClient.java

                
> LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1306
>                 URL: https://issues.apache.org/jira/browse/FLUME-1306
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Mubarak Seyed
>            Assignee: Mubarak Seyed
>              Labels: newbie
>         Attachments: FLUME-1306.trunk.v1.patch
>
>
> It appears from test that if we provide invalid host address as one of the host address in the host list, {{LoadBalancingRpcClient}} should catch exception for invalid {{RpcClient}} and failover to next in the host list.
> {code}
> ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
> java.io.IOException: Error connecting to xxxxx-xxxxx.xxxx.xxxxx.xxxx:xxxx
>         at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
>         at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
>         at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
>         at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
>         at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
>         at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
> {code}
> The proposed fix would be moving {{RpcClient client = getClient(host)}} inside {{try}} block
> {code}
> @Override
>   public void append(Event event) throws EventDeliveryException {
>     boolean eventSent = false;
>     Iterator<HostInfo> it = selector.createHostIterator();
>     while (it.hasNext()) {
>       HostInfo host = it.next();
>       try {
>         RpcClient client = getClient(host);
>         client.append(event);
>         eventSent = true;
>         break;
>       } catch (Exception ex) {
>         LOGGER.warn("Failed to send event to host " + host, ex);
>       }
>     }
>     if (!eventSent) {
>       throw new EventDeliveryException("Unable to send event to any host");
>     }
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FLUME-1306) LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one

Posted by "Mubarak Seyed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLUME-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mubarak Seyed updated FLUME-1306:
---------------------------------

    Attachment: FLUME-1306.trunk.v1.patch

The attached file is a patch. Thanks.
                
> LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1306
>                 URL: https://issues.apache.org/jira/browse/FLUME-1306
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Mubarak Seyed
>            Assignee: Mubarak Seyed
>              Labels: newbie
>         Attachments: FLUME-1306.trunk.v1.patch
>
>
> It appears from test that if we provide invalid host address as one of the host address in the host list, {{LoadBalancingRpcClient}} should catch exception for invalid {{RpcClient}} and failover to next in the host list.
> {code}
> ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
> java.io.IOException: Error connecting to xxxxx-xxxxx.xxxx.xxxxx.xxxx:xxxx
>         at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
>         at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
>         at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
>         at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
>         at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
>         at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
> {code}
> The proposed fix would be moving {{RpcClient client = getClient(host)}} inside {{try}} block
> {code}
> @Override
>   public void append(Event event) throws EventDeliveryException {
>     boolean eventSent = false;
>     Iterator<HostInfo> it = selector.createHostIterator();
>     while (it.hasNext()) {
>       HostInfo host = it.next();
>       try {
>         RpcClient client = getClient(host);
>         client.append(event);
>         eventSent = true;
>         break;
>       } catch (Exception ex) {
>         LOGGER.warn("Failed to send event to host " + host, ex);
>       }
>     }
>     if (!eventSent) {
>       throw new EventDeliveryException("Unable to send event to any host");
>     }
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (FLUME-1306) LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one

Posted by "Hari Shreedharan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLUME-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hari Shreedharan resolved FLUME-1306.
-------------------------------------

    Resolution: Fixed
    
> LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1306
>                 URL: https://issues.apache.org/jira/browse/FLUME-1306
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Mubarak Seyed
>            Assignee: Mubarak Seyed
>              Labels: newbie
>         Attachments: FLUME-1306.trunk.v1.patch
>
>
> It appears from test that if we provide invalid host address as one of the host address in the host list, {{LoadBalancingRpcClient}} should catch exception for invalid {{RpcClient}} and failover to next in the host list.
> {code}
> ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
> java.io.IOException: Error connecting to xxxxx-xxxxx.xxxx.xxxxx.xxxx:xxxx
>         at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
>         at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
>         at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
>         at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
>         at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
>         at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
> {code}
> The proposed fix would be moving {{RpcClient client = getClient(host)}} inside {{try}} block
> {code}
> @Override
>   public void append(Event event) throws EventDeliveryException {
>     boolean eventSent = false;
>     Iterator<HostInfo> it = selector.createHostIterator();
>     while (it.hasNext()) {
>       HostInfo host = it.next();
>       try {
>         RpcClient client = getClient(host);
>         client.append(event);
>         eventSent = true;
>         break;
>       } catch (Exception ex) {
>         LOGGER.warn("Failed to send event to host " + host, ex);
>       }
>     }
>     if (!eventSent) {
>       throw new EventDeliveryException("Unable to send event to any host");
>     }
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FLUME-1306) LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one

Posted by "Mubarak Seyed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLUME-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13398963#comment-13398963 ] 

Mubarak Seyed commented on FLUME-1306:
--------------------------------------

Posted for code review at https://reviews.apache.org/r/5503/
                
> LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1306
>                 URL: https://issues.apache.org/jira/browse/FLUME-1306
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Mubarak Seyed
>            Assignee: Mubarak Seyed
>              Labels: newbie
>
> It appears from test that if we provide invalid host address as one of the host address in the host list, {{LoadBalancingRpcClient}} should catch exception for invalid {{RpcClient}} and failover to next in the host list.
> {code}
> ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
> java.io.IOException: Error connecting to xxxxx-xxxxx.xxxx.xxxxx.xxxx:xxxx
>         at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
>         at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
>         at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
>         at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
>         at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
>         at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
> {code}
> The proposed fix would be moving {{RpcClient client = getClient(host)}} inside {{try}} block
> {code}
> @Override
>   public void append(Event event) throws EventDeliveryException {
>     boolean eventSent = false;
>     Iterator<HostInfo> it = selector.createHostIterator();
>     while (it.hasNext()) {
>       HostInfo host = it.next();
>       try {
>         RpcClient client = getClient(host);
>         client.append(event);
>         eventSent = true;
>         break;
>       } catch (Exception ex) {
>         LOGGER.warn("Failed to send event to host " + host, ex);
>       }
>     }
>     if (!eventSent) {
>       throw new EventDeliveryException("Unable to send event to any host");
>     }
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FLUME-1306) LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one

Posted by "Hari Shreedharan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLUME-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401727#comment-13401727 ] 

Hari Shreedharan commented on FLUME-1306:
-----------------------------------------

Patch committed. Thanks Mubarak!
                
> LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1306
>                 URL: https://issues.apache.org/jira/browse/FLUME-1306
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Mubarak Seyed
>            Assignee: Mubarak Seyed
>              Labels: newbie
>         Attachments: FLUME-1306.trunk.v1.patch
>
>
> It appears from test that if we provide invalid host address as one of the host address in the host list, {{LoadBalancingRpcClient}} should catch exception for invalid {{RpcClient}} and failover to next in the host list.
> {code}
> ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
> java.io.IOException: Error connecting to xxxxx-xxxxx.xxxx.xxxxx.xxxx:xxxx
>         at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
>         at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
>         at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
>         at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
>         at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
>         at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
> {code}
> The proposed fix would be moving {{RpcClient client = getClient(host)}} inside {{try}} block
> {code}
> @Override
>   public void append(Event event) throws EventDeliveryException {
>     boolean eventSent = false;
>     Iterator<HostInfo> it = selector.createHostIterator();
>     while (it.hasNext()) {
>       HostInfo host = it.next();
>       try {
>         RpcClient client = getClient(host);
>         client.append(event);
>         eventSent = true;
>         break;
>       } catch (Exception ex) {
>         LOGGER.warn("Failed to send event to host " + host, ex);
>       }
>     }
>     if (!eventSent) {
>       throw new EventDeliveryException("Unable to send event to any host");
>     }
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FLUME-1306) LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one

Posted by "Mubarak Seyed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLUME-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401655#comment-13401655 ] 

Mubarak Seyed commented on FLUME-1306:
--------------------------------------

Full stack-trace

{code}
2012-06-21 22:05:52.725 61694564 [Log24] ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
java.io.IOException: Error connecting to test-test1.subdomain.domain.com:port
        at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
        at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
        at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
        at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
        at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
        at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
        at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
        at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
        at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
        at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
        ..
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.nio.channels.UnresolvedAddressException
        at sun.nio.ch.Net.checkAddress(Net.java:30)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:480)
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)
        at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)
        at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60)
        at org.jboss.netty.channel.Channels.connect(Channels.java:541)
        at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)
        at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)
        at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)
        at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:246)
{code}
                
> LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1306
>                 URL: https://issues.apache.org/jira/browse/FLUME-1306
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Mubarak Seyed
>            Assignee: Mubarak Seyed
>              Labels: newbie
>
> It appears from test that if we provide invalid host address as one of the host address in the host list, {{LoadBalancingRpcClient}} should catch exception for invalid {{RpcClient}} and failover to next in the host list.
> {code}
> ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
> java.io.IOException: Error connecting to xxxxx-xxxxx.xxxx.xxxxx.xxxx:xxxx
>         at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
>         at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
>         at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
>         at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
>         at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
>         at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
> {code}
> The proposed fix would be moving {{RpcClient client = getClient(host)}} inside {{try}} block
> {code}
> @Override
>   public void append(Event event) throws EventDeliveryException {
>     boolean eventSent = false;
>     Iterator<HostInfo> it = selector.createHostIterator();
>     while (it.hasNext()) {
>       HostInfo host = it.next();
>       try {
>         RpcClient client = getClient(host);
>         client.append(event);
>         eventSent = true;
>         break;
>       } catch (Exception ex) {
>         LOGGER.warn("Failed to send event to host " + host, ex);
>       }
>     }
>     if (!eventSent) {
>       throw new EventDeliveryException("Unable to send event to any host");
>     }
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FLUME-1306) LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one

Posted by "Mubarak Seyed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLUME-1306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13401740#comment-13401740 ] 

Mubarak Seyed commented on FLUME-1306:
--------------------------------------

Thanks Hari.
                
> LoadBalancingRpcClient should catch exception for invalid RpcClient and failover to valid one
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1306
>                 URL: https://issues.apache.org/jira/browse/FLUME-1306
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Mubarak Seyed
>            Assignee: Mubarak Seyed
>              Labels: newbie
>         Attachments: FLUME-1306.trunk.v1.patch
>
>
> It appears from test that if we provide invalid host address as one of the host address in the host list, {{LoadBalancingRpcClient}} should catch exception for invalid {{RpcClient}} and failover to next in the host list.
> {code}
> ERROR org.apache.flume.api.NettyAvroRpcClient  - RPC connection error :
> java.io.IOException: Error connecting to xxxxx-xxxxx.xxxx.xxxxx.xxxx:xxxx
>         at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:249)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:198)
>         at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:147)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:118)
>         at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:107)
>         at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:446)
>         at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:83)
>         at org.apache.flume.api.LoadBalancingRpcClient.createClient(LoadBalancingRpcClient.java:190)
>         at org.apache.flume.api.LoadBalancingRpcClient.getClient(LoadBalancingRpcClient.java:173)
>         at org.apache.flume.api.LoadBalancingRpcClient.append(LoadBalancingRpcClient.java:69)
> {code}
> The proposed fix would be moving {{RpcClient client = getClient(host)}} inside {{try}} block
> {code}
> @Override
>   public void append(Event event) throws EventDeliveryException {
>     boolean eventSent = false;
>     Iterator<HostInfo> it = selector.createHostIterator();
>     while (it.hasNext()) {
>       HostInfo host = it.next();
>       try {
>         RpcClient client = getClient(host);
>         client.append(event);
>         eventSent = true;
>         break;
>       } catch (Exception ex) {
>         LOGGER.warn("Failed to send event to host " + host, ex);
>       }
>     }
>     if (!eventSent) {
>       throw new EventDeliveryException("Unable to send event to any host");
>     }
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira