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

Improve single protocol handlers #19730

Merged

Conversation

ramizdundar
Copy link
Contributor

@ramizdundar ramizdundar commented Oct 6, 2021

#18753 failed again because sometimes channel is closed before exception message is sent. I moved exceptions from decoder to encoder so this should be no longer a problem.

I also realized that TextHandshakeDecoder was missing some needed changes after SingleProtocolEncoder introduced. I also included them in this PR.

This PR should be backported to 5.0.z. I will backport after this PR is merged.

Fixes #18753
Fixes https://github.com/hazelcast/hazelcast-mono/issues/1591

EE PR: https://github.com/hazelcast/hazelcast-enterprise/pull/4348

Checklist:

  • Labels (Team:, Type:, Source:, Module:) and Milestone set
  • Add Add to Release Notes label if changes should be mentioned in release notes or Not Release Notes content if changes are not relevant for release notes
  • Request reviewers if possible
  • Send backports/forwardports if fix needs to be applied to past/future releases

@hz-devops-test
Copy link

The job Hazelcast-pr-builder of your PR failed. (Hazelcast internal details: build log, artifacts).
Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log file
--------------------------
-------TEST FAILURE-------
--------------------------
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   SingleEncoderDecoderTest.testIncompatibleProtocolSentToClient[supportedProtocol:CLIENT, receivedProtocol:ASD] Expected test to throw an instance of com.hazelcast.internal.server.tcp.ProtocolException
[ERROR]   SingleEncoderDecoderTest.testIncompatibleProtocolSentToClient[supportedProtocol:CLIENT, receivedProtocol:HZC] Expected test to throw an instance of com.hazelcast.internal.server.tcp.ProtocolException
[ERROR]   SingleEncoderDecoderTest.testIncompatibleProtocolSentToClient[supportedProtocol:MEMBER, receivedProtocol:ASD] Expected test to throw an instance of com.hazelcast.internal.server.tcp.ProtocolException
[ERROR]   SingleEncoderDecoderTest.testIncompatibleProtocolSentToClient[supportedProtocol:MEMBER, receivedProtocol:CP2] Expected test to throw an instance of com.hazelcast.internal.server.tcp.ProtocolException
[INFO] 
[ERROR] Tests run: 46505, Failures: 4, Errors: 0, Skipped: 1011
[INFO] 

[ERROR] There are test failures.

AdvancedNetworkIntegrationTest#testCompleteMultisocketConfig covers this case because exception thrown in the SingleProtocolDecoder now.
@ufukyilmaz
Copy link
Contributor

ufukyilmaz commented Oct 7, 2021

It looks good to me in general. But, I will be waiting for AdvancedNetworkingTest to be completed without failure in a repeated run setting: http://jenkins.hazelcast.com/job/ufuk-Hazelcast-EE-runner/13/ before approving the pr.

Copy link
Contributor

@ufukyilmaz ufukyilmaz left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. LGTM

@ramizdundar
Copy link
Contributor Author

Thank you for the reviews.

@ramizdundar ramizdundar merged commit 4224341 into hazelcast:master Oct 8, 2021
ramizdundar added a commit to ramizdundar/hazelcast that referenced this pull request Oct 8, 2021
* Throw exception in the decoder instead of the encoder

* Extend missing error handling to TextHandshakeDecoder

* Delete SingleEncoderDecoderTest as it's no longer needed.

(cherry picked from commit 4224341)
ramizdundar added a commit that referenced this pull request Oct 12, 2021
* Throw exception in the decoder instead of the encoder

* Extend missing error handling to TextHandshakeDecoder

* Delete SingleEncoderDecoderTest as it's no longer needed.

(cherry picked from commit 4224341)
@ramizdundar ramizdundar deleted the improve_single_protocol_handlers branch January 4, 2022 10:22
@devOpsHazelcast
Copy link
Collaborator

Can one of the admins verify this patch?

2 similar comments
@devOpsHazelcast
Copy link
Collaborator

Can one of the admins verify this patch?

@devOpsHazelcast
Copy link
Collaborator

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

com.hazelcast.internal.networking.nio.AdvancedNetworkIntegrationTest.testConnectionToWrongPort
5 participants