[ 
https://issues.apache.org/jira/browse/STORM-1609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15185876#comment-15185876
 ] 

ASF GitHub Bot commented on STORM-1609:
---------------------------------------

Github user d2r commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1194#discussion_r55432071
  
    --- Diff: storm-core/src/jvm/org/apache/storm/messaging/netty/Client.java 
---
    @@ -151,10 +164,35 @@
             bootstrap = createClientBootstrap(factory, bufferSize, stormConf);
             dstAddress = new InetSocketAddress(host, port);
             dstAddressPrefixedName = prefixedName(dstAddress);
    +        launchChannelAliveThread();
             scheduleConnect(NO_DELAY_MS);
             batcher = new MessageBuffer(messageBatchSize);
         }
     
    +    /**
    +     * This thread helps us to check for channel connection periodically.
    +     * This is performed just to know whether the destination address
    +     * is alive or attempts to refresh connections if not alive. This
    +     * solution is better than what we have now in case of a bad channel.
    +     */
    +    private void launchChannelAliveThread() {
    +        // netty TimerTask is already defined and hence a fully
    +        // qualified name
    +        timer.schedule(new java.util.TimerTask() {
    +            public void run() {
    +                try {
    +                    LOG.debug("running timer task, address {}", 
dstAddress);
    +                    if(closing) {
    +                        this.cancel();
    --- End diff --
    
    Just to be cleaner and avoid a possible race, let's return here so we don't 
call `getConnectedChannel`.


> Netty Client is not best effort delivery on failed Connection
> -------------------------------------------------------------
>
>                 Key: STORM-1609
>                 URL: https://issues.apache.org/jira/browse/STORM-1609
>             Project: Apache Storm
>          Issue Type: Bug
>            Reporter: Sanket Reddy
>            Assignee: Sanket Reddy
>
> f Worker-A has connection to Worker-B that is unused ( and if Worker-B 
> restarted), we drop messages because Channel is not in good state. Can we 
> avoid message drop until we succeed in making new connection or a timeout?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to