You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Joshua McKenzie (JIRA)" <ji...@apache.org> on 2015/09/18 21:41:04 UTC

[jira] [Commented] (CASSANDRA-10141) UFPureScriptTest fails with pre-3.0 java-driver

    [ https://issues.apache.org/jira/browse/CASSANDRA-10141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14876228#comment-14876228 ] 

Joshua McKenzie commented on CASSANDRA-10141:
---------------------------------------------

Comments:
* Looks like some code for CASSANDRA-10367 snuck in on {{UDHelper.deserialize}}
* Instead of {{SecurityThreadGroup.getAllowedPackages()}}, I'd prefer the interface be {{SecurityThreadGroup.isPackageAllowed(String pkg)}} to tidy up {{ThreadAwareSecurityManager.checkPackageAccess(...)}} and keep the logic for package checking local w/the data.
* Comment in {{checkAccess}} is unclear to me: {{// need to override since the default implementation is kind of ...}}. It's kind of... what?
* Some empty comment lines in {{ThreadAwareSecurityManager.checkPermission}} and {{UDFunction.initializeThread}}
* nit: Would like a bit more commenting in {{UDFunction.initializeThread}} as to the "why" of the optimization rather than just what you're doing there. i.e. a side-effect of codecFor is to init the java driver, for instance.

On the whole, looks pretty straightforward and test passes for me w/this patch.

> UFPureScriptTest fails with pre-3.0 java-driver
> -----------------------------------------------
>
>                 Key: CASSANDRA-10141
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10141
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Joshua McKenzie
>            Assignee: Robert Stupp
>              Labels: UDF
>             Fix For: 3.0.x
>
>
> {noformat}
>     [junit] ------------- ---------------- ---------------
>     [junit] Testcase: testJavascriptTupleTypeCollection(org.apache.cassandra.cql3.validation.entities.UFPureScriptTest):        Caused an ERROR
>     [junit] execution of 'cql_test_keyspace_alt.function_3[tuple<double, frozen<list<double>>, frozen<set<text>>, frozen<map<int, boolean>>>]' failed: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
>     [junit] org.apache.cassandra.exceptions.FunctionExecutionException: execution of 'cql_test_keyspace_alt.function_3[tuple<double, frozen<list<double>>, frozen<set<text>>, frozen<map<int, boolean>>>]' failed: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
>     [junit]     at org.apache.cassandra.exceptions.FunctionExecutionException.create(FunctionExecutionException.java:35)
>     [junit]     at org.apache.cassandra.cql3.functions.UDFunction.execute(UDFunction.java:287)
>     [junit]     at org.apache.cassandra.cql3.selection.ScalarFunctionSelector.getOutput(ScalarFunctionSelector.java:60)
>     [junit]     at org.apache.cassandra.cql3.selection.Selection$SelectionWithProcessing$1.getOutputRow(Selection.java:535)
>     [junit]     at org.apache.cassandra.cql3.selection.Selection$ResultSetBuilder.getOutputRow(Selection.java:363)
>     [junit]     at org.apache.cassandra.cql3.selection.Selection$ResultSetBuilder.build(Selection.java:351)
>     [junit]     at org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:599)
>     [junit]     at org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:363)
>     [junit]     at org.apache.cassandra.cql3.statements.SelectStatement.executeInternal(SelectStatement.java:379)
>     [junit]     at org.apache.cassandra.cql3.statements.SelectStatement.executeInternal(SelectStatement.java:72)
>     [junit]     at org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal(QueryProcessor.java:337)
>     [junit]     at org.apache.cassandra.cql3.CQLTester.execute(CQLTester.java:654)
>     [junit]     at org.apache.cassandra.cql3.validation.entities.UFPureScriptTest.testJavascriptTupleTypeCollection(UFPureScriptTest.java:178)
>     [junit] Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
>     [junit]     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)
>     [junit]     at java.security.AccessController.checkPermission(AccessController.java:884)
>     [junit]     at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
>     [junit]     at org.apache.cassandra.cql3.functions.ThreadAwareSecurityManager.checkPermission(ThreadAwareSecurityManager.java:164)
>     [junit]     at java.lang.Class.checkMemberAccess(Class.java:2348)
>     [junit]     at java.lang.Class.getEnclosingMethod(Class.java:1037)
>     [junit]     at java.lang.Class.getGenericSuperclass(Class.java:777)
>     [junit]     at com.google.common.reflect.TypeCapture.capture(TypeCapture.java:33)
>     [junit]     at com.google.common.reflect.TypeToken.<init>(TypeToken.java:113)
>     [junit]     at com.datastax.driver.core.CodecUtils$4.<init>(CodecUtils.java:44)
>     [junit]     at com.datastax.driver.core.CodecUtils.listOf(CodecUtils.java:44)
>     [junit]     at com.datastax.driver.core.AbstractGettableByIndexData.getList(AbstractGettableByIndexData.java:347)
>     [junit]     at com.datastax.driver.core.TupleValue.getList(TupleValue.java:21)
>     [junit]     at com.datastax.driver.core.AbstractGettableByIndexData.getList(AbstractGettableByIndexData.java:336)
>     [junit]     at com.datastax.driver.core.TupleValue.getList(TupleValue.java:21)
>     [junit]     at jdk.nashorn.internal.scripts.Script$2$\^eval\_.:program(<eval>:1)
>     [junit]     at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:636)
>     [junit]     at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:229)
>     [junit]     at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:387)
>     [junit]     at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:414)
>     [junit]     at jdk.nashorn.api.scripting.NashornScriptEngine.access$300(NashornScriptEngine.java:70)
>     [junit]     at jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:499)
>     [junit]     at org.apache.cassandra.cql3.functions.ScriptBasedUDFunction.executeUserDefined(ScriptBasedUDFunction.java:181)
>     [junit]     at org.apache.cassandra.cql3.functions.UDFunction.lambda$executeAsync$65(UDFunction.java:332)
>     [junit]     at org.apache.cassandra.cql3.functions.UDFunction$$Lambda$78/1590792382.call(Unknown Source)
>     [junit]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>     [junit]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>     [junit]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>     [junit]     at java.lang.Thread.run(Thread.java:745)
>     [junit]
>     [junit]
>     [junit] Test org.apache.cassandra.cql3.validation.entities.UFPureScriptTest FAILED
> [junitreport] Processing c:\cassandra\build\test\TESTS-TestSuites.xml to C:\temp\null1341670821
> [junitreport] Loading stylesheet jar:file:/C:/apps/apache-ant/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
> [junitreport] Transform time: 261ms
> [junitreport] Deleting: C:\temp\null1341670821
> BUILD FAILED
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)