These threads get scheduled on the default Agent/soloExecutorthread pool
Since these threads are being created at init time, they wind up inheriting the context ClassLoader from the base classloader in the JVM.
However, when the Spark worker process runs an application, the dependencies in the app jar are downloaded at runtime, so it inserts a new MutableURLClassLoader as the thread context when it launches the job.
This means code run in that thread (or descendants of that thread) works as expected, but any code run on one of the threads started by dialog would mysteriously fail to load classes that were only present in the app jar.
Shelling out in a logging library is probably undesirable even without these class loading shenanigans, so to address this I'm just going to remove the shell call and use the Java-native way of finding the current hostname. This includes a mutator method if clients really want to change the default value after the fact.
This is causing a super gnarly issue in our Spark code, due to the following chain of events:
hostname
to get the canonical hostname in linux: https://github.com/amperity/dialog/blob/69ccd2c6b4772d9a2f19098372026d98bd7eeb6c/src/clojure/dialog/util.clj#L72future
threads to handle the command IO.Agent/soloExecutor
thread poolClassLoader
from the base classloader in the JVM.MutableURLClassLoader
as the thread context when it launches the job.Shelling out in a logging library is probably undesirable even without these class loading shenanigans, so to address this I'm just going to remove the shell call and use the Java-native way of finding the current hostname. This includes a mutator method if clients really want to change the default value after the fact.