"scott.stark@jboss.org" wrote:
This type of test is tricky because it takes two threads with one handling the load of a one class and the other handling the load of superclass or field related classes. I'd just make it a todo for now.
You'd probably need:
1) to use a dummy ClassLoaderPolicy so you can cause classloading requests to wait
with the classloading locks held by different threads
2) get locks on the classloaders before making the classloading requests to simulate
what loadClassInternal() does.
The basic rule should be that
a) if the thread is interrupted before you make the classloading request then the request should work.
b) But you should be able to interrupt a thread if it is stuck in a classloading task wait.
Neither should lead to a live/deadlock in the classloading.
One issue that occurs to me though with (b) is that it will end up throwing a
ClassNotFoundException which will likely end up causing the class to be
blacklisted. We should really work around this by throwing some sort of
TemporaryClassNotFoundException to show the request maybe retried later?