[
https://issues.apache.org/jira/browse/STORM-1609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15186360#comment-15186360
]
ASF GitHub Bot commented on STORM-1609:
---------------------------------------
Github user bugzmanov commented on a diff in the pull request:
https://github.com/apache/storm/pull/1194#discussion_r55464579
--- Diff: storm-core/src/jvm/org/apache/storm/messaging/netty/Client.java
---
@@ -151,10 +159,43 @@
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
+ if (timer == null) {
--- End diff --
This looks a lot like racy(incorrect) version of:
https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java
So you might end up with two instances of timer running 1 job each
> 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)