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

Fix #18668: set interfaces must not be added when loopback mode nor loopback interface are used #18669

Merged
merged 7 commits into from
May 26, 2021

Conversation

TomaszGaweda
Copy link
Contributor

Fix #18668: set interfaces must not be added when loopback mode nor loopback interface are used

Restores old code of adding setInterfaces, without modification of other branches.

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
  • New public APIs have @Nonnull/@Nullable annotations
  • New public APIs have @since tags in Javadoc
  • Send backports/forwardports if fix needs to be applied to past/future releases

@hz-devops-test hz-devops-test added the Source: Community PR or issue was opened by a community user label May 12, 2021
@vbekiaris vbekiaris added this to the 5.0 milestone May 12, 2021
@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
--------------------------
---------SUMMARY----------
--------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:checkstyle (default) on project hazelcast: An error has occurred in Checkstyle report generation. Failed during checkstyle execution: There is 1 error reported by Checkstyle 8.38 with /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder/checkstyle/checkstyle.xml ruleset. -> [Help 1]
--------------------------
---------ERRORS-----------
--------------------------
[ERROR] /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/MulticastService.java:127:68: '{' is not preceded with whitespace. [WhitespaceAround]
--------------------------

@TomaszGaweda
Copy link
Contributor Author

Sorry, forgot to run checkstyle again after some rearrangement of code. Should be fixed now

@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]   MulticastDeserializationTest.testWithoutFilter:103->lambda$testWithoutFilter$0:103 Object was not deserialized
[INFO] 
[ERROR] Tests run: 3990, Failures: 1, Errors: 0, Skipped: 20
[INFO] 

[ERROR] There are test failures.

@TomaszGaweda
Copy link
Contributor Author

TomaszGaweda commented May 13, 2021

@vbekiaris TBH I have no idea why this test fails, works on my machine. Do you have any ideas?

Edit: test seems to be flaky, fails also on my computer after few tries

@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]   MulticastDeserializationTest.testWithoutFilter:103->lambda$testWithoutFilter$0:103 Object was not deserialized
[INFO] 
[ERROR] Tests run: 3997, Failures: 1, Errors: 0, Skipped: 20
[INFO] 

[ERROR] There are test failures.

@TomaszGaweda
Copy link
Contributor Author

obraz

I have no idea o.O

@vbekiaris
Copy link
Contributor

I haven't properly reviewed this PR yet, however it feels like effects of multicast socket address binding are platform-dependent. I don't like exposing yet another config to users, but this seems like one of the cases where it's probably safer to make it user configurable as proposed in #18403. /cc @kwart wdyt?

@TomaszGaweda
Copy link
Contributor Author

Sounds ok at first look, but up to know it.. just worked :) On 4.1.1 multicast works on our test environment (CentOS 7) and our local Windows machines. Also, test is about deserialization, while connectivity seems to have nothing to do with serialization.
I'm not against more general PR, just throwing my thoughts, as those fails are really strange

@kwart kwart self-requested a review May 14, 2021 05:48
@kwart
Copy link
Member

kwart commented May 17, 2021

I agree with Vassilis, we hit repeatedly issues in this area. So we should allow users to explicitly force (or disable) the MulticastSocket.setInterface(...) call.
I'm suggesting a solution which adds a new cluster property in TomaszGaweda#8. Using the property allows simple backporting. Most users should not care about this configuration option and default multicast service behavior should work for them.
@vbekiaris Could you also take a look at TomaszGaweda#8?

The new property doesn't have a test coverage (yet). I'll think if there is a simple way to test it.
Update: tests were added in a new commit.

@vbekiaris
Copy link
Contributor

@kwart thanks for looking into this. The approach in TomaszGaweda#8 looks good.
In terms of configuration, maybe we can add the cluster property as suggested in 4.2.z and add it as deprecated in master with additional proper config support in MulticastConfig.

@kwart
Copy link
Member

kwart commented May 17, 2021

Vassilis, I don't think this Java issue workaround deserves an extra field in the MulticastConfig. I would leave it as the cluster&system property only.

kwart and others added 2 commits May 17, 2021 10:56
@TomaszGaweda
Copy link
Contributor Author

Hi @kwart, your PR works great, thank you :)

@kwart kwart requested a review from vbekiaris May 18, 2021 08:18
@hazelcast hazelcast deleted a comment from vbekiaris May 18, 2021
@hazelcast hazelcast deleted a comment from devOpsHazelcast May 18, 2021
@hazelcast hazelcast deleted a comment from vbekiaris May 18, 2021
@hazelcast hazelcast deleted a comment from TomaszGaweda May 18, 2021
@hazelcast hazelcast deleted a comment from vbekiaris May 18, 2021
@hazelcast hazelcast deleted a comment from TomaszGaweda May 18, 2021
@kwart
Copy link
Member

kwart commented May 18, 2021

@TomaszGaweda thanks for testing and fix confirmation!

@vbekiaris vbekiaris merged commit 6f9de91 into hazelcast:master May 26, 2021
@vbekiaris
Copy link
Contributor

thanks @TomaszGaweda & @kwart for resolving the issue. Can we backport the fix to 4.2.z?

TomaszGaweda added a commit to TomaszGaweda/hazelcast that referenced this pull request Sep 13, 2021
…ode nor loopback interface are used (hazelcast#18669)

* Fix hazelcast#18668: set interfaces must not be added when loopback mode nor loopback interface are used

* Add ClusterProperty.MULTICAST_SOCKET_SET_INTERFACE and align socket handling in the MulticastService.

Co-authored-by: Josef Cacek <josef.cacek@gmail.com>
(cherry picked from commit 6f9de91)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multicast discovery no longer works between machines when loopback mode enabled
4 participants