Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protosubff : heartbeat data is null causes connect close #4645

Closed
wants to merge 3 commits into from

Conversation

chenyu2016
Copy link

@chenyu2016 chenyu2016 commented Jul 24, 2019

What is the purpose of the change

repair protosubff heartbeat data is null causes connect close

Brief changelog

ExchangeCodec. decodeBody
     -->if (res.isHeartbeat()) {
                        // data = decodeHeartbeatData(channel, in);
                        data = null;
                    }
ExchangeCodec.encodeEventData(ObjectOutput out, Object data)
if(data != null) {
            out.writeObject(data);
        }else{
            logger.warn("encodeEventData  data is null");
        }

Verifying this change

Dubbo version: 2.7.1
Operating System version: mac
Java version: 1.8

Copy link
Member

@beiwei30 beiwei30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chenyu2016 pls. take a look at my comments.

@beiwei30
Copy link
Member

ps, the following failure is found from travis CI 'HeartbeatHandlerTest.testHeartbeat:95 expected: <0> but was: <2>'. It will not happen if your change follows my suggestion.

@beiwei30
Copy link
Member

@chenyu2016 CI still fails:

[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   ExchangeCodecTest.test_Decode_Error_Request_Object:296 expected: <true> but was: <false>
[ERROR]   ExchangeCodecTest.test_Decode_Return_Request_Event_Object:235 expected: <org.apache.dubbo.remoting.codec.TelnetCodecTest$Person@3c1> but was: <null>
[ERROR]   ExchangeCodecTest.test_Decode_Return_Request_Event_String:250 expected: <R> but was: <null>
[ERROR]   ExchangeCodecTest.test_Decode_Return_Request_Object:278 expected: <org.apache.dubbo.remoting.codec.TelnetCodecTest$Person@3c1> but was: <null>

@chenyu2016
Copy link
Author

chenyu2016 commented Jul 25, 2019 via email

@beiwei30
Copy link
Member

CI still fail:

[ERROR] Failures: 
[ERROR]   ExchangeCodecTest.test_Decode_Error_Request_Object:296 expected: <true> but was: <false>
[ERROR]   ExchangeCodecTest.test_Decode_Return_Request_Event_Object:235 expected: <org.apache.dubbo.remoting.codec.TelnetCodecTest$Person@3c1> but was: <null>
[ERROR]   ExchangeCodecTest.test_Decode_Return_Request_Event_String:250 expected: <R> but was: <null>
[ERROR]   ExchangeCodecTest.test_Decode_Return_Request_Object:278 expected: <org.apache.dubbo.remoting.codec.TelnetCodecTest$Person@3c1> but was: <null>
[INFO] 
[ERROR] Tests run: 342, Failures: 4, Errors: 0, Skipped: 1

@beiwei30
Copy link
Member

@chenyu2016 I revisit this particular issue today, and the null heartbeat issue should have been solved by #3734.

But I also realize that encodeHeartbeatData and decodeHeartbeatData are in fact useless, therefore I submit a new pull request #4673 to address it.

Pls. verify if it works for you. I will close this pull request for now, feel free to reopen if you have different opinion.

@beiwei30 beiwei30 closed this Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants