[jira] [Comment Edited] (CASSANDRA-18181) Fix tests post JDK-8210522 (rewrite reflection of "modifiers" field)
[ https://issues.apache.org/jira/browse/CASSANDRA-18181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17682286#comment-17682286 ] Ekaterina Dimitrova edited comment on CASSANDRA-18181 at 1/30/23 9:34 PM: -- Well, at the end a bunch of commits landed on Friday while I was doing "final" testing Rebase and last pre-commit run only with J8 for sanity check: [https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/2201/workflows/12e1be71-d6d1-49be-8c3e-7e471bfac92a] was (Author: e.dimitrova): Well, at the end a bunch of commits ended on Friday while I was doing "final" testing Rebase and last pre-commit run only with J8 for sanity check: [https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/2201/workflows/12e1be71-d6d1-49be-8c3e-7e471bfac92a] > Fix tests post JDK-8210522 (rewrite reflection of "modifiers" field) > > > Key: CASSANDRA-18181 > URL: https://issues.apache.org/jira/browse/CASSANDRA-18181 > Project: Cassandra > Issue Type: Bug > Components: CI >Reporter: Ekaterina Dimitrova >Assignee: Ekaterina Dimitrova >Priority: Normal > Fix For: 4.x > > > > From JDK-8210522: > {code:java} > Core reflection has a filtering mechanism to hide security and integrity > sensitive fields and methods from Class getXXXField(s) and getXXXMethod(s). > The filtering mechanism has been used for several releases to hide security > sensitive fields such as System.security and Class.classLoader. > This CSR proposes to extend the filters to hide fields from a number of > highly security sensitive classes in java.lang.reflect and java.lang.invoke. > {code} > We are using at a few places in our tests > {code:java} > Field.class.getDeclaredField("modifiers");{code} > This breaks as expected when tests are run with JDK17, example: > > {code:java} > java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers > at > org.apache.cassandra.transport.MessagePayloadTest.makeCqlQueryHandlerAccessible(MessagePayloadTest.java:79) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) > at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:568) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) > at > org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at > org.junit.runner.JUnitCore.run(JUnitCore.java:137) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) > at > com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) > at > com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221) > at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) > Caused by: java.lang.NoSuchFieldException: modifiers at > java.base/java.lang.Class.getDeclaredField(Class.java:2610) > at > org.apache.cassandra.transport.MessagePayloadTest.makeCqlQueryHandlerAccessible(MessagePayloadTest.java:70) > > ... 15 more{code} > -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-18181) Fix tests post JDK-8210522
[ https://issues.apache.org/jira/browse/CASSANDRA-18181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17680809#comment-17680809 ] Ekaterina Dimitrova edited comment on CASSANDRA-18181 at 1/25/23 9:20 PM: -- Oops, I totally misread. I just reloaded it [here|https://ci-cassandra.apache.org/job/Cassandra-devbranch-artifacts/], thanks! was (Author: e.dimitrova): Ops, totally misunderstood. I just reloaded it [here|https://ci-cassandra.apache.org/job/Cassandra-devbranch-artifacts/], thanks! > Fix tests post JDK-8210522 > -- > > Key: CASSANDRA-18181 > URL: https://issues.apache.org/jira/browse/CASSANDRA-18181 > Project: Cassandra > Issue Type: Bug > Components: CI >Reporter: Ekaterina Dimitrova >Assignee: Ekaterina Dimitrova >Priority: Normal > Fix For: 4.x > > > > From JDK-8210522: > {code:java} > Core reflection has a filtering mechanism to hide security and integrity > sensitive fields and methods from Class getXXXField(s) and getXXXMethod(s). > The filtering mechanism has been used for several releases to hide security > sensitive fields such as System.security and Class.classLoader. > This CSR proposes to extend the filters to hide fields from a number of > highly security sensitive classes in java.lang.reflect and java.lang.invoke. > {code} > We are using at a few places in our tests > {code:java} > Field.class.getDeclaredField("modifiers");{code} > This breaks as expected when tests are run with JDK17, example: > > {code:java} > java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers > at > org.apache.cassandra.transport.MessagePayloadTest.makeCqlQueryHandlerAccessible(MessagePayloadTest.java:79) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) > at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:568) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) > at > org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at > org.junit.runner.JUnitCore.run(JUnitCore.java:137) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) > at > com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) > at > com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221) > at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) > Caused by: java.lang.NoSuchFieldException: modifiers at > java.base/java.lang.Class.getDeclaredField(Class.java:2610) > at > org.apache.cassandra.transport.MessagePayloadTest.makeCqlQueryHandlerAccessible(MessagePayloadTest.java:70) > > ... 15 more{code} > -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-18181) Fix tests post JDK-8210522
[ https://issues.apache.org/jira/browse/CASSANDRA-18181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679481#comment-17679481 ] Ekaterina Dimitrova edited comment on CASSANDRA-18181 at 1/21/23 10:26 PM: --- Wall of failures in DTests, probably it didn't download the updated DTest trunk branch Just pushed it again [here|https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2214/] was (Author: e.dimitrova): Wall of failures in DTests, probably it didn't download the updated DTest trunk branch Just pushed it again [here|https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2213/] > Fix tests post JDK-8210522 > -- > > Key: CASSANDRA-18181 > URL: https://issues.apache.org/jira/browse/CASSANDRA-18181 > Project: Cassandra > Issue Type: Bug > Components: CI >Reporter: Ekaterina Dimitrova >Assignee: Ekaterina Dimitrova >Priority: Normal > Fix For: 4.x > > > > From JDK-8210522: > {code:java} > Core reflection has a filtering mechanism to hide security and integrity > sensitive fields and methods from Class getXXXField(s) and getXXXMethod(s). > The filtering mechanism has been used for several releases to hide security > sensitive fields such as System.security and Class.classLoader. > This CSR proposes to extend the filters to hide fields from a number of > highly security sensitive classes in java.lang.reflect and java.lang.invoke. > {code} > We are using at a few places in our tests > {code:java} > Field.class.getDeclaredField("modifiers");{code} > This breaks as expected when tests are run with JDK17, example: > > {code:java} > java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers > at > org.apache.cassandra.transport.MessagePayloadTest.makeCqlQueryHandlerAccessible(MessagePayloadTest.java:79) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) > at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:568) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) > at > org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at > org.junit.runner.JUnitCore.run(JUnitCore.java:137) > at > com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) > at > com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) > at > com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221) > at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) > Caused by: java.lang.NoSuchFieldException: modifiers at > java.base/java.lang.Class.getDeclaredField(Class.java:2610) > at > org.apache.cassandra.transport.MessagePayloadTest.makeCqlQueryHandlerAccessible(MessagePayloadTest.java:70) > > ... 15 more{code} > -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-18181) Fix tests post JDK-8210522
[ https://issues.apache.org/jira/browse/CASSANDRA-18181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679225#comment-17679225 ] Ekaterina Dimitrova edited comment on CASSANDRA-18181 at 1/20/23 4:51 PM: -- h5. This affects Java distributed tests, [Instance.startup|https://github.com/apache/cassandra/blob/trunk/test/distributed/org/apache/cassandra/distributed/impl/Instance.java#L653] and some other tests: * ConnectionTest * ProxyHandlerConnectionsTest * ConnectionBurnTestTest * FramingTest * MessageSerializationPropertyTest * MessageTest * OutboundConnectionsTest * ProxyHandlerConnectionsTest * DriverBurnTests * SimpleClientBurnTest * MessagePayloadTest The patch is posted [here|https://github.com/ekaterinadimitrova2/cassandra/commit/a06dbb6b8f90d5b92dfa6ebffd276a218fae57fe] The solution used is similar to what other projects did, for example HBase. It was already discussed in CASSANDRA-17178 Pushed Jenkins CI run (to cover J8+J11), the job is in the queue as there are already 2 jobs running in Jenkins dev. I will check back and post a link later today to the trunk J8+J11 Jenkins CI run but I am fairly confident the run will be fine as I ran some of the tests locally and I was running this patch also with JDK17 for some time, too. Here is the run with J17 branch [J11|https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/2182/workflows/9ca49487-937a-4c72-bc78-4fbefe23db76] and [J17|https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/2182/workflows/e3dc630b-b7a4-4f5b-8f29-489bf43ad90f] there are certain failures but those are not related to what we address here. While this patch is not needed for J8+J11 It is a preparation for when we switch to J11+J17. Trying to push in everything we can until CASSANDRA-17281 and a few other things are disentangled was (Author: e.dimitrova): h5. This affects Java distributed tests, Instance.startup and some other tests: * ConnectionTest * ProxyHandlerConnectionsTest * ConnectionBurnTestTest * FramingTest * MessageSerializationPropertyTest * MessageTest * OutboundConnectionsTest * ProxyHandlerConnectionsTest * DriverBurnTests * SimpleClientBurnTest * MessagePayloadTest The patch is posted [here|https://github.com/ekaterinadimitrova2/cassandra/commit/a06dbb6b8f90d5b92dfa6ebffd276a218fae57fe] The solution used is similar to what other projects did, for example HBase. It was already discussed in CASSANDRA-17178 Pushed Jenkins CI run (to cover J8+J11), the job is in the queue as there are already 2 jobs running in Jenkins dev. I will check back and post a link later today to the trunk J8+J11 Jenkins CI run but I am fairly confident the run will be fine as I ran some of the tests locally and I was running this patch also with JDK17 for some time, too. Here is the run with J17 branch [J11|https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/2182/workflows/9ca49487-937a-4c72-bc78-4fbefe23db76] and [J17|https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/2182/workflows/e3dc630b-b7a4-4f5b-8f29-489bf43ad90f] there are certain failures but those are not related to what we address here. While this patch is not needed for J8+J11 It is a preparation for when we switch to J11+J17. Trying to push in everything we can until CASSANDRA-17281 and a few other things are disentangled > Fix tests post JDK-8210522 > -- > > Key: CASSANDRA-18181 > URL: https://issues.apache.org/jira/browse/CASSANDRA-18181 > Project: Cassandra > Issue Type: Bug > Components: CI >Reporter: Ekaterina Dimitrova >Assignee: Ekaterina Dimitrova >Priority: Normal > Fix For: 4.x > > > > From JDK-8210522: > {code:java} > Core reflection has a filtering mechanism to hide security and integrity > sensitive fields and methods from Class getXXXField(s) and getXXXMethod(s). > The filtering mechanism has been used for several releases to hide security > sensitive fields such as System.security and Class.classLoader. > This CSR proposes to extend the filters to hide fields from a number of > highly security sensitive classes in java.lang.reflect and java.lang.invoke. > {code} > We are using at a few places in our tests > {code:java} > Field.class.getDeclaredField("modifiers");{code} > This breaks as expected when tests are run with JDK17, example: > > {code:java} > java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers > at > org.apache.cassandra.transport.MessagePayloadTest.makeCqlQueryHandlerAccessible(MessagePayloadTest.java:79) > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor