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

Tim Shea commented on TOREE-421:
--------------------------------

I am having the same issue, trying to connect to my Ignite cluster from inside 
a toree notebook. Documenting here.

Name: java.lang.SecurityException
Message: Not allowed to modify ThreadGroups!
StackTrace:   at 
org.apache.toree.security.KernelSecurityManager.checkAccess(KernelSecurityManager.scala:114)
  at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
  at java.lang.Thread.init(Thread.java:391)
  at java.lang.Thread.init(Thread.java:349)
  at java.lang.Thread.<init>(Thread.java:596)
  at org.apache.ignite.thread.IgniteThread.<init>(IgniteThread.java:100)
  at org.apache.ignite.thread.IgniteThread.<init>(IgniteThread.java:85)
  at 
org.apache.ignite.internal.util.StripedExecutor$Stripe.start(StripedExecutor.java:438)
  at 
org.apache.ignite.internal.util.StripedExecutor.<init>(StripedExecutor.java:84)
  at 
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1730)
  at 
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1648)
  at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1076)
  at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:506)
  at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:482)
  at org.apache.ignite.Ignition.start(Ignition.java:304)

> KernelSecurityManager doesn't allow users to create their own thread groups
> ---------------------------------------------------------------------------
>
>                 Key: TOREE-421
>                 URL: https://issues.apache.org/jira/browse/TOREE-421
>             Project: TOREE
>          Issue Type: Bug
>            Reporter: Piyush Narang
>
> I'm trying to run a Spark Scala job using Toree and I'm running into some 
> issues as the code in our job calls into one of our libraries which tries to 
> create threads in its own ThreadGroup: 
> https://github.com/twitter/util/blob/develop/util-core/src/main/scala/com/twitter/concurrent/NamedPoolThreadFactory.scala#L28
> This seems to cause this check in Toree's KernelSecurityManager to trip: 
> https://github.com/apache/incubator-toree/blob/master/kernel-api/src/main/scala/org/apache/toree/security/KernelSecurityManager.scala#L121
> Stack looks like:
> {code}
> Name: java.lang.SecurityException
> Message: Not allowed to modify ThreadGroups!
> StackTrace:   at 
> org.apache.toree.security.KernelSecurityManager.checkAccess(KernelSecurityManager.scala:114)
>   at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
>   at java.lang.Thread.init(Thread.java:394)
>   at java.lang.Thread.init(Thread.java:349)
>   at java.lang.Thread.<init>(Thread.java:599)
>   at 
> com.twitter.concurrent.NamedPoolThreadFactory.newThread(NamedPoolThreadFactory.scala:32)
> ...
> {code}
> Here's a simple repro:
> {code}
> println(Thread.currentThread().getThreadGroup) // default thread group
> val group: ThreadGroup = new 
> ThreadGroup(Thread.currentThread().getThreadGroup(), "name")
> val hello = new Thread(group, new Runnable {
>     def run() {
>     println("hello world")
>   }
> })
> println(hello.getThreadGroup)
> hello.start
> {code}
> Any suggestions for working around this? 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to