You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2020/06/29 15:02:20 UTC
[GitHub] [storm] Ethanlm commented on a change in pull request #3296: [STORM-3661] handle exception when netty server receive unexpected message
Ethanlm commented on a change in pull request #3296:
URL: https://github.com/apache/storm/pull/3296#discussion_r447039454
##########
File path: storm-client/src/jvm/org/apache/storm/messaging/netty/Server.java
##########
@@ -260,7 +260,15 @@ public void channelActive(Channel c) {
@Override
public void received(Object message, String remote, Channel channel) throws InterruptedException {
- List<TaskMessage> msgs = (List<TaskMessage>) message;
+ List<TaskMessage> msgs;
+
+ try {
+ msgs = (List<TaskMessage>) message;
+ } catch (ClassCastException e) {
+ LOG.error("Worker netty server receive message other than the expected class List<TaskMessage> from remote: {}", remote, e);
Review comment:
nit: `receive` -> `received` ;
And ad the log to indicate the message is ignored will be helpful
##########
File path: storm-client/src/jvm/org/apache/storm/messaging/netty/Server.java
##########
@@ -260,7 +260,15 @@ public void channelActive(Channel c) {
@Override
public void received(Object message, String remote, Channel channel) throws InterruptedException {
- List<TaskMessage> msgs = (List<TaskMessage>) message;
+ List<TaskMessage> msgs;
+
+ try {
+ msgs = (List<TaskMessage>) message;
+ } catch (ClassCastException e) {
+ LOG.error("Worker netty server receive message other than the expected class List<TaskMessage> from remote: {}", remote, e);
Review comment:
nit: `receive` -> `received` ;
And add the log to indicate the message is ignored will be helpful
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org