[GitHub] storm pull request #2741: STORM-3124 reconnect to pacemaker on failure

2018-06-29 Thread srdo
Github user srdo commented on a diff in the pull request:

https://github.com/apache/storm/pull/2741#discussion_r199193610
  
--- Diff: 
storm-client/src/jvm/org/apache/storm/messaging/netty/KerberosSaslClientHandler.java
 ---
@@ -96,53 +96,69 @@ private void handleControlMessage(ChannelHandlerContext 
ctx, ControlMessage cont
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
 if (controlMessage == ControlMessage.SASL_COMPLETE_REQUEST) {
-LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
+LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
 
-if (!saslNettyClient.isComplete()) {
+if (!saslNettyClient.isComplete()) {
 String errorMessage =
 "Server returned a Sasl-complete message, but as far 
as we can tell, we are not authenticated yet.";
 LOG.error(errorMessage);
 throw new Exception(errorMessage);
-}
+}
 ctx.pipeline().remove(this);
 this.client.channelReady(channel);
 
 // We call fireChannelRead since the client is allowed to
-// perform this request. The client's request will now 
proceed
-// to the next pipeline component namely 
StormClientHandler.
+// perform this request. The client's request will now proceed
+// to the next pipeline component namely StormClientHandler.
 ctx.fireChannelRead(controlMessage);
-} else {
+} else {
 LOG.warn("Unexpected control message: {}", controlMessage);
-}
+}
 }
 
 private void handleSaslMessageToken(ChannelHandlerContext ctx, 
SaslMessageToken saslMessageToken) throws Exception {
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
-LOG.debug("Responding to server's token of length: {}",
-saslMessageToken.getSaslToken().length);
-
-// Generate SASL response (but we only actually send the 
response if
-// it's non-null.
-byte[] responseToServer = saslNettyClient
-.saslResponse(saslMessageToken);
-if (responseToServer == null) {
-// If we generate a null response, then authentication has 
completed
-// (if not, warn), and return without sending a response 
back to the
-// server.
-LOG.debug("Response to server is null: authentication 
should now be complete.");
-if (!saslNettyClient.isComplete()) {
-LOG.warn("Generated a null response, but 
authentication is not complete.");
-throw new Exception("Our reponse to the server is 
null, but as far as we can tell, we are not authenticated yet.");
-}
-this.client.channelReady(channel);
-} else {
-LOG.debug("Response to server token has length: {}",
-  responseToServer.length);
-// Construct a message containing the SASL response and send 
it to the
+LOG.debug("Responding to server's token of length: {}", 
saslMessageToken.getSaslToken().length);
+
+// Generate SASL response (but we only actually send the response 
if
+// it's non-null.
+byte[] responseToServer = 
saslNettyClient.saslResponse(saslMessageToken);
+if (responseToServer == null) {
+// If we generate a null response, then authentication has 
completed
+// (if not, warn), and return without sending a response back 
to the
 // server.
+LOG.debug("Response to server is null: authentication should 
now be complete.");
+if (!saslNettyClient.isComplete()) {
+LOG.warn("Generated a null response, but authentication is 
not complete.");
+throw new Exception("Our reponse to the server is null, 
but as far as we can tell, we are not authenticated yet.");
+}
+this.client.channelReady(channel);
+} else {
+LOG.debug("Response to server token has length: {}",
+  responseToServer.length);
+// Construct a message containing the SASL response and send 
it to the server.
 SaslMessageToken saslResponse = new 
SaslMessageToken(responseToServer);
 channel.writeAndFlush(saslResponse, channel.voidPromise());
   

[GitHub] storm pull request #2741: STORM-3124 reconnect to pacemaker on failure

2018-06-29 Thread agresch
Github user agresch commented on a diff in the pull request:

https://github.com/apache/storm/pull/2741#discussion_r199145547
  
--- Diff: 
storm-client/src/jvm/org/apache/storm/messaging/netty/KerberosSaslClientHandler.java
 ---
@@ -96,53 +96,69 @@ private void handleControlMessage(ChannelHandlerContext 
ctx, ControlMessage cont
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
 if (controlMessage == ControlMessage.SASL_COMPLETE_REQUEST) {
-LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
+LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
 
-if (!saslNettyClient.isComplete()) {
+if (!saslNettyClient.isComplete()) {
 String errorMessage =
 "Server returned a Sasl-complete message, but as far 
as we can tell, we are not authenticated yet.";
 LOG.error(errorMessage);
 throw new Exception(errorMessage);
-}
+}
 ctx.pipeline().remove(this);
 this.client.channelReady(channel);
 
 // We call fireChannelRead since the client is allowed to
-// perform this request. The client's request will now 
proceed
-// to the next pipeline component namely 
StormClientHandler.
+// perform this request. The client's request will now proceed
+// to the next pipeline component namely StormClientHandler.
 ctx.fireChannelRead(controlMessage);
-} else {
+} else {
 LOG.warn("Unexpected control message: {}", controlMessage);
-}
+}
 }
 
 private void handleSaslMessageToken(ChannelHandlerContext ctx, 
SaslMessageToken saslMessageToken) throws Exception {
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
-LOG.debug("Responding to server's token of length: {}",
-saslMessageToken.getSaslToken().length);
-
-// Generate SASL response (but we only actually send the 
response if
-// it's non-null.
-byte[] responseToServer = saslNettyClient
-.saslResponse(saslMessageToken);
-if (responseToServer == null) {
-// If we generate a null response, then authentication has 
completed
-// (if not, warn), and return without sending a response 
back to the
-// server.
-LOG.debug("Response to server is null: authentication 
should now be complete.");
-if (!saslNettyClient.isComplete()) {
-LOG.warn("Generated a null response, but 
authentication is not complete.");
-throw new Exception("Our reponse to the server is 
null, but as far as we can tell, we are not authenticated yet.");
-}
-this.client.channelReady(channel);
-} else {
-LOG.debug("Response to server token has length: {}",
-  responseToServer.length);
-// Construct a message containing the SASL response and send 
it to the
+LOG.debug("Responding to server's token of length: {}", 
saslMessageToken.getSaslToken().length);
+
+// Generate SASL response (but we only actually send the response 
if
+// it's non-null.
+byte[] responseToServer = 
saslNettyClient.saslResponse(saslMessageToken);
+if (responseToServer == null) {
+// If we generate a null response, then authentication has 
completed
+// (if not, warn), and return without sending a response back 
to the
 // server.
+LOG.debug("Response to server is null: authentication should 
now be complete.");
+if (!saslNettyClient.isComplete()) {
+LOG.warn("Generated a null response, but authentication is 
not complete.");
+throw new Exception("Our reponse to the server is null, 
but as far as we can tell, we are not authenticated yet.");
+}
+this.client.channelReady(channel);
+} else {
+LOG.debug("Response to server token has length: {}",
+  responseToServer.length);
+// Construct a message containing the SASL response and send 
it to the server.
 SaslMessageToken saslResponse = new 
SaslMessageToken(responseToServer);
 channel.writeAndFlush(saslResponse, channel.voidPromise());

[GitHub] storm pull request #2741: STORM-3124 reconnect to pacemaker on failure

2018-06-28 Thread srdo
Github user srdo commented on a diff in the pull request:

https://github.com/apache/storm/pull/2741#discussion_r199057391
  
--- Diff: 
storm-client/src/jvm/org/apache/storm/messaging/netty/KerberosSaslClientHandler.java
 ---
@@ -96,53 +96,69 @@ private void handleControlMessage(ChannelHandlerContext 
ctx, ControlMessage cont
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
 if (controlMessage == ControlMessage.SASL_COMPLETE_REQUEST) {
-LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
+LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
 
-if (!saslNettyClient.isComplete()) {
+if (!saslNettyClient.isComplete()) {
 String errorMessage =
 "Server returned a Sasl-complete message, but as far 
as we can tell, we are not authenticated yet.";
 LOG.error(errorMessage);
 throw new Exception(errorMessage);
-}
+}
 ctx.pipeline().remove(this);
 this.client.channelReady(channel);
 
 // We call fireChannelRead since the client is allowed to
-// perform this request. The client's request will now 
proceed
-// to the next pipeline component namely 
StormClientHandler.
+// perform this request. The client's request will now proceed
+// to the next pipeline component namely StormClientHandler.
 ctx.fireChannelRead(controlMessage);
-} else {
+} else {
 LOG.warn("Unexpected control message: {}", controlMessage);
-}
+}
 }
 
 private void handleSaslMessageToken(ChannelHandlerContext ctx, 
SaslMessageToken saslMessageToken) throws Exception {
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
-LOG.debug("Responding to server's token of length: {}",
-saslMessageToken.getSaslToken().length);
-
-// Generate SASL response (but we only actually send the 
response if
-// it's non-null.
-byte[] responseToServer = saslNettyClient
-.saslResponse(saslMessageToken);
-if (responseToServer == null) {
-// If we generate a null response, then authentication has 
completed
-// (if not, warn), and return without sending a response 
back to the
-// server.
-LOG.debug("Response to server is null: authentication 
should now be complete.");
-if (!saslNettyClient.isComplete()) {
-LOG.warn("Generated a null response, but 
authentication is not complete.");
-throw new Exception("Our reponse to the server is 
null, but as far as we can tell, we are not authenticated yet.");
-}
-this.client.channelReady(channel);
-} else {
-LOG.debug("Response to server token has length: {}",
-  responseToServer.length);
-// Construct a message containing the SASL response and send 
it to the
+LOG.debug("Responding to server's token of length: {}", 
saslMessageToken.getSaslToken().length);
+
+// Generate SASL response (but we only actually send the response 
if
+// it's non-null.
+byte[] responseToServer = 
saslNettyClient.saslResponse(saslMessageToken);
+if (responseToServer == null) {
+// If we generate a null response, then authentication has 
completed
+// (if not, warn), and return without sending a response back 
to the
 // server.
+LOG.debug("Response to server is null: authentication should 
now be complete.");
+if (!saslNettyClient.isComplete()) {
+LOG.warn("Generated a null response, but authentication is 
not complete.");
+throw new Exception("Our reponse to the server is null, 
but as far as we can tell, we are not authenticated yet.");
+}
+this.client.channelReady(channel);
+} else {
+LOG.debug("Response to server token has length: {}",
+  responseToServer.length);
+// Construct a message containing the SASL response and send 
it to the server.
 SaslMessageToken saslResponse = new 
SaslMessageToken(responseToServer);
 channel.writeAndFlush(saslResponse, channel.voidPromise());
   

[GitHub] storm pull request #2741: STORM-3124 reconnect to pacemaker on failure

2018-06-28 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/storm/pull/2741


---


[GitHub] storm pull request #2741: STORM-3124 reconnect to pacemaker on failure

2018-06-28 Thread danny0405
Github user danny0405 commented on a diff in the pull request:

https://github.com/apache/storm/pull/2741#discussion_r198736753
  
--- Diff: 
storm-client/src/jvm/org/apache/storm/messaging/netty/KerberosSaslClientHandler.java
 ---
@@ -96,53 +96,69 @@ private void handleControlMessage(ChannelHandlerContext 
ctx, ControlMessage cont
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
 if (controlMessage == ControlMessage.SASL_COMPLETE_REQUEST) {
-LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
+LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
 
-if (!saslNettyClient.isComplete()) {
+if (!saslNettyClient.isComplete()) {
 String errorMessage =
 "Server returned a Sasl-complete message, but as far 
as we can tell, we are not authenticated yet.";
 LOG.error(errorMessage);
 throw new Exception(errorMessage);
-}
+}
 ctx.pipeline().remove(this);
 this.client.channelReady(channel);
 
 // We call fireChannelRead since the client is allowed to
-// perform this request. The client's request will now 
proceed
-// to the next pipeline component namely 
StormClientHandler.
+// perform this request. The client's request will now proceed
+// to the next pipeline component namely StormClientHandler.
 ctx.fireChannelRead(controlMessage);
-} else {
+} else {
 LOG.warn("Unexpected control message: {}", controlMessage);
-}
+}
 }
 
 private void handleSaslMessageToken(ChannelHandlerContext ctx, 
SaslMessageToken saslMessageToken) throws Exception {
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
-LOG.debug("Responding to server's token of length: {}",
-saslMessageToken.getSaslToken().length);
-
-// Generate SASL response (but we only actually send the 
response if
-// it's non-null.
-byte[] responseToServer = saslNettyClient
-.saslResponse(saslMessageToken);
-if (responseToServer == null) {
-// If we generate a null response, then authentication has 
completed
-// (if not, warn), and return without sending a response 
back to the
-// server.
-LOG.debug("Response to server is null: authentication 
should now be complete.");
-if (!saslNettyClient.isComplete()) {
-LOG.warn("Generated a null response, but 
authentication is not complete.");
-throw new Exception("Our reponse to the server is 
null, but as far as we can tell, we are not authenticated yet.");
-}
-this.client.channelReady(channel);
-} else {
-LOG.debug("Response to server token has length: {}",
-  responseToServer.length);
-// Construct a message containing the SASL response and send 
it to the
+LOG.debug("Responding to server's token of length: {}", 
saslMessageToken.getSaslToken().length);
+
+// Generate SASL response (but we only actually send the response 
if
+// it's non-null.
+byte[] responseToServer = 
saslNettyClient.saslResponse(saslMessageToken);
+if (responseToServer == null) {
+// If we generate a null response, then authentication has 
completed
+// (if not, warn), and return without sending a response back 
to the
 // server.
+LOG.debug("Response to server is null: authentication should 
now be complete.");
+if (!saslNettyClient.isComplete()) {
+LOG.warn("Generated a null response, but authentication is 
not complete.");
+throw new Exception("Our reponse to the server is null, 
but as far as we can tell, we are not authenticated yet.");
+}
+this.client.channelReady(channel);
+} else {
+LOG.debug("Response to server token has length: {}",
+  responseToServer.length);
+// Construct a message containing the SASL response and send 
it to the server.
 SaslMessageToken saslResponse = new 
SaslMessageToken(responseToServer);
 channel.writeAndFlush(saslResponse, channel.voidPromise());
  

[GitHub] storm pull request #2741: STORM-3124 reconnect to pacemaker on failure

2018-06-27 Thread revans2
Github user revans2 commented on a diff in the pull request:

https://github.com/apache/storm/pull/2741#discussion_r198638777
  
--- Diff: 
storm-client/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java ---
@@ -153,13 +154,13 @@ public String secretKey() {
 }
 
 public HBMessage send(HBMessage m) throws 
PacemakerConnectionException, InterruptedException {
-LOG.debug("Sending message: {}", m.toString());
+LOG.debug("Sending pacemaker message to {}: {}", host, 
m.toString());
--- End diff --

nit: can we drop the `.toString()` for m? The log command should do it for 
you, if it is needed.


---


[GitHub] storm pull request #2741: STORM-3124 reconnect to pacemaker on failure

2018-06-27 Thread revans2
Github user revans2 commented on a diff in the pull request:

https://github.com/apache/storm/pull/2741#discussion_r198638417
  
--- Diff: 
storm-client/src/jvm/org/apache/storm/messaging/netty/KerberosSaslClientHandler.java
 ---
@@ -96,53 +96,69 @@ private void handleControlMessage(ChannelHandlerContext 
ctx, ControlMessage cont
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
 if (controlMessage == ControlMessage.SASL_COMPLETE_REQUEST) {
-LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
+LOG.debug("Server has sent us the SaslComplete message. 
Allowing normal work to proceed.");
 
-if (!saslNettyClient.isComplete()) {
+if (!saslNettyClient.isComplete()) {
 String errorMessage =
 "Server returned a Sasl-complete message, but as far 
as we can tell, we are not authenticated yet.";
 LOG.error(errorMessage);
 throw new Exception(errorMessage);
-}
+}
 ctx.pipeline().remove(this);
 this.client.channelReady(channel);
 
 // We call fireChannelRead since the client is allowed to
-// perform this request. The client's request will now 
proceed
-// to the next pipeline component namely 
StormClientHandler.
+// perform this request. The client's request will now proceed
+// to the next pipeline component namely StormClientHandler.
 ctx.fireChannelRead(controlMessage);
-} else {
+} else {
 LOG.warn("Unexpected control message: {}", controlMessage);
-}
+}
 }
 
 private void handleSaslMessageToken(ChannelHandlerContext ctx, 
SaslMessageToken saslMessageToken) throws Exception {
 Channel channel = ctx.channel();
 KerberosSaslNettyClient saslNettyClient = 
getChannelSaslClient(channel);
-LOG.debug("Responding to server's token of length: {}",
-saslMessageToken.getSaslToken().length);
-
-// Generate SASL response (but we only actually send the 
response if
-// it's non-null.
-byte[] responseToServer = saslNettyClient
-.saslResponse(saslMessageToken);
-if (responseToServer == null) {
-// If we generate a null response, then authentication has 
completed
-// (if not, warn), and return without sending a response 
back to the
-// server.
-LOG.debug("Response to server is null: authentication 
should now be complete.");
-if (!saslNettyClient.isComplete()) {
-LOG.warn("Generated a null response, but 
authentication is not complete.");
-throw new Exception("Our reponse to the server is 
null, but as far as we can tell, we are not authenticated yet.");
-}
-this.client.channelReady(channel);
-} else {
-LOG.debug("Response to server token has length: {}",
-  responseToServer.length);
-// Construct a message containing the SASL response and send 
it to the
+LOG.debug("Responding to server's token of length: {}", 
saslMessageToken.getSaslToken().length);
+
+// Generate SASL response (but we only actually send the response 
if
+// it's non-null.
+byte[] responseToServer = 
saslNettyClient.saslResponse(saslMessageToken);
+if (responseToServer == null) {
+// If we generate a null response, then authentication has 
completed
+// (if not, warn), and return without sending a response back 
to the
 // server.
+LOG.debug("Response to server is null: authentication should 
now be complete.");
+if (!saslNettyClient.isComplete()) {
+LOG.warn("Generated a null response, but authentication is 
not complete.");
+throw new Exception("Our reponse to the server is null, 
but as far as we can tell, we are not authenticated yet.");
+}
+this.client.channelReady(channel);
+} else {
+LOG.debug("Response to server token has length: {}",
+  responseToServer.length);
+// Construct a message containing the SASL response and send 
it to the server.
 SaslMessageToken saslResponse = new 
SaslMessageToken(responseToServer);
 channel.writeAndFlush(saslResponse, channel.voidPromise());

[GitHub] storm pull request #2741: STORM-3124 reconnect to pacemaker on failure

2018-06-27 Thread agresch
GitHub user agresch opened a pull request:

https://github.com/apache/storm/pull/2741

STORM-3124 reconnect to pacemaker on failure



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/agresch/storm agresch_pacemaker_connect

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/storm/pull/2741.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2741


commit 8cd3aa25fd8463a161b684e2674b653aa344efbe
Author: Aaron Gresch 
Date:   2018-06-27T19:57:28Z

STORM-3124 reconnect to pacemaker on failure




---