apache/storm — pull request #304 by Sergeant007 (2014-10-29 15:44:35+00:00)
Title: [STORM-537] A worker reconnects infinitely to another dead worker

A fix for [STORM-537](https://issues.apache.org/jira/browse/STORM-537). The bug is that a worker reconnects to another dead worker infinitely when it tries to send a batch of messages. Each message in a batch causes a new reconnect. More details are in the jira issue.

Pull request contains a simple fix and tests. Actually there is "test-reconnect-to-permanently-failed-server" which is exactly for this bug. There is also "test-reconnect-to-temporarily-failed-server" which was written just-for-fun, because this functionality is not covered by other tests.

Note, that storm with applied fix works well and fixed the issue on our staging environment.