lambdaisland

cjohansen 2024-11-06T12:54:13.687239Z

We're seeing a security exception when launchpad reloads stuff. It's not entirely consistent, but happens relatively frequently. Sometimes the reload was still successful, other times nothing has changed. Has anyone else experienced this? See stack trace in ๐Ÿงต

plexus 2024-11-29T09:34:18.604989Z

yes, I have seen that before, but thanks for raising this, because it made me realize there's an easy fix. lambdaisland.classpath loops over all threads to set the contextclassloader. We should just skip InnocuousThread instances. I'm not sure when these types of threads are used, and if you would try to load clojure code from such a thread it would not pick up the new classpath, but there's not much we can do about that.

cjohansen 2024-11-29T09:34:54.825809Z

Aha, it's a specific kind of thread

cjohansen 2024-11-29T09:35:04.811249Z

Sounds like a good plan

plexus 2024-11-29T09:40:54.014609Z

could you test with lambdaisland/classpath "5a891483200a6cbf856db4ff827f44b33353cbd1"?

plexus 2024-11-29T09:41:50.479239Z

com.lambdaisland/classpath
{:git/url ""
 :git/sha "5a891483200a6cbf856db4ff827f44b33353cbd1"}

cjohansen 2024-11-29T09:45:57.259199Z

Seems to work ๐Ÿ‘ Although I don't really know how to reproduce the stack trace. I booted the process with the new classpath dependency, and tried to dynamically add a dep to deps.edn, and it reloaded without error.

cjohansen 2024-11-29T09:46:19.812779Z

I'll keep using it and let you know if I run into issues. Thanks ๐Ÿ˜Š

๐Ÿ‘ 1
plexus 2024-11-29T09:47:41.049049Z

I'll try to cut a release and upgrade launchpad. Probably next week.

๐Ÿ‘ 1
cjohansen 2024-11-06T12:54:21.353809Z

[watch-deps] โœจ Reloading deps.edn โœจ
Error in lambdaisland.classpath/install-priority-loader! #error {
 :cause setContextClassLoader
 :via
 [{:type java.lang.SecurityException
   :message setContextClassLoader
   :at [jdk.internal.misc.InnocuousThread setContextClassLoader InnocuousThread.java 168]}]
 :trace
 [[jdk.internal.misc.InnocuousThread setContextClassLoader InnocuousThread.java 168]
  [lambdaisland.classpath$install_priority_loader_BANG_$fn__51854 invoke classpath.clj 399]
  [clojure.core$binding_conveyor_fn$fn__5842 invoke core.clj 2047]
  [clojure.lang.AFn call AFn.java 18]
  [java.util.concurrent.FutureTask run FutureTask.java 317]
  [java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java 1144]
  [java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java 642]
  [java.lang.Thread run Thread.java 1570]]}
[watch-deps] + node_modules/@mattilsynet/design
Error in lambdaisland.classpath/install-priority-loader! #error {
 :cause setContextClassLoader
 :via
 [{:type java.lang.SecurityException
   :message setContextClassLoader
   :at [jdk.internal.misc.InnocuousThread setContextClassLoader InnocuousThread.java 168]}]
 :trace
 [[jdk.internal.misc.InnocuousThread setContextClassLoader InnocuousThread.java 168]
  [lambdaisland.classpath$install_priority_loader_BANG_$fn__51854 invoke classpath.clj 399]
  [clojure.core$binding_conveyor_fn$fn__5842 invoke core.clj 2047]
  [clojure.lang.AFn call AFn.java 18]
  [java.util.concurrent.FutureTask run FutureTask.java 317]
  [java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java 1144]
  [java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java 642]
  [java.lang.Thread run Thread.java 1570]]}