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

Extend permission checks in MessageTasks and add a test coverage [HZ-2090] #25509

Merged
merged 3 commits into from Sep 22, 2023

Conversation

kwart
Copy link
Member

@kwart kwart commented Sep 21, 2023

This PR extends permission checks in client messages and adds basic test coverage.

@kwart kwart added this to the 5.4.0 milestone Sep 21, 2023
@kwart kwart requested a review from a team as a code owner September 21, 2023 13:46
@kwart kwart force-pushed the fix/5.4/HZ-2090-getRequiredPermission branch from ad85ee5 to 18a0a59 Compare September 22, 2023 06:36
@hazelcast hazelcast deleted a comment from hz-devops-test Sep 22, 2023
@hazelcast hazelcast deleted a comment from hz-devops-test Sep 22, 2023
@kwart kwart force-pushed the fix/5.4/HZ-2090-getRequiredPermission branch from 7ba726d to 0372936 Compare September 22, 2023 09:12
@hazelcast hazelcast deleted a comment from hz-devops-test Sep 22, 2023
@kwart
Copy link
Member Author

kwart commented Sep 22, 2023

run-ee-nightly-tests

@kwart
Copy link
Member Author

kwart commented Sep 22, 2023

run-ee-tests

@hz-devops-test
Copy link

The job Hazelcast-pr-builder-ee-nightly-tests 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
---------ERRORS-----------
--------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.1.2:test (default-test) on project hazelcast-enterprise-native-memory: 
--------------------------
[ERROR] 
--------------------------
[ERROR] Please refer to /home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/hazelcast-enterprise/hazelcast-enterprise-native-memory/target/surefire-reports for the individual test results.
--------------------------
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
--------------------------
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
--------------------------
[ERROR] Command was /bin/sh -c cd '/home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/hazelcast-enterprise/hazelcast-enterprise-native-memory' && '/usr/share/jdks/oracle-11/bin/java' '-Xms1g' '-Xmx1g' '-verbose:gc' '-Xloggc:/home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/test_gc.log' '--add-exports' 'java.base/jdk.internal.ref=ALL-UNNAMED' '--add-opens' 'java.base/java.nio=ALL-UNNAMED' '--add-opens' 'java.base/sun.nio.ch=ALL-UNNAMED' '--add-opens' 'java.base/java.lang=ALL-UNNAMED' '--add-opens' 'jdk.management/com.sun.management.internal=ALL-UNNAMED' '--add-opens' 'java.management/sun.management=ALL-UNNAMED' '--add-exports' 'jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED' '--illegal-access=warn' '-ea' '-Dhazelcast.hidensity.check.freememory=false' '-Dhazelcast.phone.home.enabled=false' '-Dhazelcast.logging.type=none' '-Dhazelcast.test.use.network=false' '-Dlog4j.skipJansi=true' '-jar' '/home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/hazelcast-enterprise/hazelcast-enterprise-native-memory/target/surefire/surefirebooter-20230922092346642_3.jar' '/home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/hazelcast-enterprise/hazelcast-enterprise-native-memory/target/surefire' '2023-09-22T09-23-46_449-jvmRun1' 'surefire-20230922092346642_1tmp' 'surefire_0-20230922092346642_2tmp'
--------------------------
[ERROR] Error occurred in starting fork, check output in log
--------------------------
[ERROR] Process Exit Code: 134
--------------------------
[ERROR] Crashed tests:
--------------------------
[ERROR] com.hazelcast.internal.memory.GlobalPoolingMemoryManagerStressTest
--------------------------
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
--------------------------
[ERROR] Command was /bin/sh -c cd '/home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/hazelcast-enterprise/hazelcast-enterprise-native-memory' && '/usr/share/jdks/oracle-11/bin/java' '-Xms1g' '-Xmx1g' '-verbose:gc' '-Xloggc:/home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/test_gc.log' '--add-exports' 'java.base/jdk.internal.ref=ALL-UNNAMED' '--add-opens' 'java.base/java.nio=ALL-UNNAMED' '--add-opens' 'java.base/sun.nio.ch=ALL-UNNAMED' '--add-opens' 'java.base/java.lang=ALL-UNNAMED' '--add-opens' 'jdk.management/com.sun.management.internal=ALL-UNNAMED' '--add-opens' 'java.management/sun.management=ALL-UNNAMED' '--add-exports' 'jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED' '--illegal-access=warn' '-ea' '-Dhazelcast.hidensity.check.freememory=false' '-Dhazelcast.phone.home.enabled=false' '-Dhazelcast.logging.type=none' '-Dhazelcast.test.use.network=false' '-Dlog4j.skipJansi=true' '-jar' '/home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/hazelcast-enterprise/hazelcast-enterprise-native-memory/target/surefire/surefirebooter-20230922092346642_3.jar' '/home/jenkins/jenkins_slave/workspace/Hazelcast-pr-builder-ee-nightly-tests_2/hazelcast-enterprise/hazelcast-enterprise-native-memory/target/surefire' '2023-09-22T09-23-46_449-jvmRun1' 'surefire-20230922092346642_1tmp' 'surefire_0-20230922092346642_2tmp'
--------------------------
[ERROR] Error occurred in starting fork, check output in log
--------------------------
[ERROR] Process Exit Code: 134
--------------------------
[ERROR] Crashed tests:
--------------------------
[ERROR] com.hazelcast.internal.memory.GlobalPoolingMemoryManagerStressTest
--------------------------
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:643)
--------------------------
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285)
--------------------------
[ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250)
--------------------------
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1203)
--------------------------
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1055)
--------------------------
[ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:871)
--------------------------
[ERROR] 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:342)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:330)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:175)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:76)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:163)
--------------------------
[ERROR] 	at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:160)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
--------------------------
[ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
--------------------------
[ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
--------------------------
[ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
--------------------------
[ERROR] 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
--------------------------
[ERROR] 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:910)
--------------------------
[ERROR] 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
--------------------------
[ERROR] 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
--------------------------
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
--------------------------
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
--------------------------
[ERROR] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
--------------------------
[ERROR] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
--------------------------
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
--------------------------
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
--------------------------
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
--------------------------
[ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)
--------------------------
[ERROR] -> [Help 1]
--------------------------
[ERROR] 
--------------------------
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
--------------------------
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
--------------------------
[ERROR] 
--------------------------
[ERROR] For more information about the errors and possible solutions, please read the following articles:
--------------------------
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
--------------------------
[ERROR] 
--------------------------
[ERROR] After correcting the problems, you can resume the build with the command
--------------------------
[ERROR]   mvn  -rf :hazelcast-enterprise-native-memory
--------------------------

@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
---------ERRORS-----------
--------------------------
[ERROR] Tests run: 13, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.075 s <<< FAILURE! -- in com.hazelcast.internal.tpcengine.nio.NioAsyncServerSocketTest
--------------------------
[ERROR] com.hazelcast.internal.tpcengine.nio.NioAsyncServerSocketTest.test_createCloseLoop_withSameReactor -- Time elapsed: 0.219 s <<< ERROR!
--------------------------
[ERROR] Errors: 
--------------------------
[ERROR]   NioAsyncServerSocketTest>AsyncServerSocketTest.test_createCloseLoop_withSameReactor:255 ? UncheckedIO Failed to bind to /127.0.0.1:5001
--------------------------
[ERROR] Tests run: 292, Failures: 0, Errors: 1, Skipped: 0
--------------------------
[ERROR] 
--------------------------

Copy link
Member Author

@kwart kwart left a comment

Choose a reason for hiding this comment

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

Thank you for the review, Serkan.

Copy link
Contributor

@gbarnett-hz gbarnett-hz left a comment

Choose a reason for hiding this comment

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

LGTM -- just minor note on Throwable -> Exception

@@ -98,8 +100,8 @@ private static Set<Map.Entry<Data, Data>> fetchMapSnapshotFrom(List<Future> futu
Object result;
try {
result = future.get();
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
} catch (Exception e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason this is now more specific?

Copy link
Member Author

Choose a reason for hiding this comment

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

Our Sonar gatekeeper was unhappy about the changed file (even the given try block was not touched). So I tried to make Sonar happier after checking the file history.

@kwart
Copy link
Member Author

kwart commented Sep 22, 2023

Thanks for the (re)reviews, guys. 🙇

@kwart
Copy link
Member Author

kwart commented Sep 22, 2023

run-lab-run

@kwart kwart enabled auto-merge (squash) September 22, 2023 19:21
@kwart kwart merged commit 8150451 into hazelcast:master Sep 22, 2023
8 of 10 checks passed
@kwart kwart deleted the fix/5.4/HZ-2090-getRequiredPermission branch September 22, 2023 21:59
kwart added a commit to kwart/hazelcast that referenced this pull request Sep 25, 2023
…2090] (hazelcast#25509)

This change extends permission checks in client messages and adds a basic test
coverage.
kwart added a commit to kwart/hazelcast that referenced this pull request Sep 25, 2023
…2090] (hazelcast#25509)

This change extends permission checks in client messages and adds a basic test
coverage.
kwart added a commit to kwart/hazelcast that referenced this pull request Sep 26, 2023
kwart added a commit to kwart/hazelcast that referenced this pull request Sep 26, 2023
kwart added a commit to kwart/hazelcast that referenced this pull request Sep 26, 2023
kwart added a commit that referenced this pull request Oct 4, 2023
…2090] [5.3.z] (#25539)

Backport of #25509

This PR extends permission checks in client messages and adds basic test
coverage.
JamesHazelcast pushed a commit to vbekiaris/hazelcast that referenced this pull request Oct 12, 2023
…2090] (hazelcast#25509)

This change extends permission checks in client messages and adds a basic test
coverage.
JamesHazelcast pushed a commit to vbekiaris/hazelcast that referenced this pull request Oct 12, 2023
kwart added a commit that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] (#25703)

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to #25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit to kwart/hazelcast that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] (hazelcast#25703)

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to hazelcast#25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit to kwart/hazelcast that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] (hazelcast#25703)

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to hazelcast#25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] [5.3.3] (#25711)

Backport of #25703

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to #25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] [5.3.z] (#25710)

Backport of #25703

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to #25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit to kwart/hazelcast that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] (hazelcast#25703)

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to hazelcast#25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit to kwart/hazelcast that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] (hazelcast#25703)

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to hazelcast#25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit to kwart/hazelcast that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] (hazelcast#25703)

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to hazelcast#25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit to kwart/hazelcast that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] (hazelcast#25703)

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to hazelcast#25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit to kwart/hazelcast that referenced this pull request Oct 13, 2023
…eProxiesMessageTask [HZ-3464] (hazelcast#25703)

Fixes https://hazelcast.atlassian.net/browse/HZ-3464

Follow-up to hazelcast#25509

This PR aligns check permission behavior in the message task with the
message description in the [protocol
definition](https://github.com/hazelcast/hazelcast-client-protocol/blob/master/protocol-definitions/Client.yaml#L721):

```
Any proxy creation failure is logged on the server side.
Exceptions related to a proxy creation failure is not send to the client.
A proxy creation failure does not cancel this operation, all proxies will be attempted to be created.
```
kwart added a commit that referenced this pull request Oct 16, 2023
…2090] [5.2.z] (#25540)

Backport of #25509

This PR extends permission checks in client messages and adds basic test
coverage.
kwart added a commit that referenced this pull request Oct 16, 2023
…2090] [5.1.z] (#25541)

Backport of #25509

This PR extends permission checks in client messages and adds basic test
coverage.
kwart added a commit that referenced this pull request Oct 16, 2023
…2090] [5.0.z] (#25542)

Backport of #25509

This PR extends permission checks in client messages and adds basic test
coverage.
kwart added a commit that referenced this pull request Oct 16, 2023
…2090] [4.1.z] (#25544)

Backport of #24271, #25509, and #25703

This PR extends permission checks in client messages and adds basic test
coverage.
kwart added a commit that referenced this pull request Oct 17, 2023
…2090] [4.2.z] (#25543)

Backport of #24271, #25509, and #25703

This PR extends permission checks in client messages and adds basic test
coverage.
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.

None yet

4 participants