1 2 Previous Next 17 Replies Latest reply on Mar 5, 2009 6:12 AM by adrian.brock

    InterruptedException not being cleared?

    starksm64

      It looks like an InterruptedException may not be getting cleared. I was debugging an admin console issue and it timed out, presumably setting the interrupted state on a thread and now it keeps hanging with a class load failure due to an InterruptedException.

      07:45:02,097 WARN [ClassLoaderManager] Unexpected error during load of:org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryDeployer
      java.lang.InterruptedException
       at java.lang.Object.wait(Native Method)
       at java.lang.Object.wait(Object.java:474)
       at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:211)
       at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:152)
       at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:259)
       at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1102)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:772)
       at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:415)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.jboss.deployers.plugins.managed.BeanMetaDataICF.getManagedObjectClass(BeanMetaDataICF.java:135)
       at org.jboss.deployers.plugins.managed.BeanMetaDataICF.getManagedObjectClass(BeanMetaDataICF.java:48)
       at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.initManagedObject(AbstractManagedObjectFactory.java:342)
       at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.getManagedObjectValue(AbstractInstanceClassFactory.java:315)
       at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.getManagedObjectArray(AbstractInstanceClassFactory.java:331)
       at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.getValue(AbstractInstanceClassFactory.java:252)
       at org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator.populateValues(AbstractManagedObjectPopulator.java:204)
       at org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator.populateManagedObject(AbstractManagedObjectPopulator.java:130)
       at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.initManagedObject(AbstractManagedObjectFactory.java:367)
       at org.jboss.deployers.spi.deployer.helpers.DefaultManagedObjectCreator.build(DefaultManagedObjectCreator.java:81)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.getManagedObjects(DeployersImpl.java:463)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.getManagedObjects(MainDeployerImpl.java:928)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.getManagedDeployment(MainDeployerImpl.java:905)
       at org.jboss.profileservice.management.ManagementViewImpl.getManagedDeployment(ManagementViewImpl.java:1300)
       at org.jboss.profileservice.management.ManagementViewImpl.loadProfile(ManagementViewImpl.java:212)
       at sun.reflect.GeneratedMethodAccessor317.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
       at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:99)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
       at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
       at org.jboss.remoting.Client.invoke(Client.java:1708)
       at org.jboss.remoting.Client.invoke(Client.java:612)
       at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at AOPProxy$1.loadProfile(AOPProxy$1.java)
       at org.rhq.plugins.jbossas5.factory.ProfileServiceFactory.refreshCurrentProfileView(ProfileServiceFactory.java:113)
       at org.rhq.plugins.jbossas5.ManagedDeploymentComponent.getManagedDeployment(ManagedDeploymentComponent.java:335)
       at org.rhq.plugins.jbossas5.ManagedDeploymentComponent.getAvailability(ManagedDeploymentComponent.java:133)
       at sun.reflect.GeneratedMethodAccessor330.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:466)
       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
       at java.util.concurrent.FutureTask.run(FutureTask.java:123)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:613)
      



        • 1. Re: InterruptedException not being cleared?
          starksm64

          Actually, I'm seeing this even after a restart of the server, so I don't know what is setting the interrupted state.

          • 2. Re: InterruptedException not being cleared?
            shelly.mcgowan

            https://jira.jboss.org/jira/browse/JBAS-6546 filed as this is seen when running the automated tests.

            • 3. Re: InterruptedException not being cleared?
              dmlloyd

              I'm not very familiar with the classloader guts here, but shouldn't it be possible to load a class even if the current thread's interrupt status is set?

              • 4. Re: InterruptedException not being cleared?
                starksm64

                Not without the caller clearing the state as its the concurrent layer that will throw the exception. We aren't going to ignore that in the class loading layer.

                • 5. Re: InterruptedException not being cleared?
                  dmlloyd

                  I didn't mean ignore it, just defer it - after all the thread could be asynchronously interrupted and I don't think that the best thing to do would be to blow up in that case. Anyway, consuming the InterruptedException is definitely the wrong thing to do regarless of where the status is being set (and that's really what it's doing now, looking at ClassLoaderManager.java:169). It should catch the exception, set a flag, continue what it's doing, then reset the interrupt status on exit; that or rethrow InterruptedException (which it cannot do in this case, since loadClass doesn't throw that exception).

                  • 6. Re: InterruptedException not being cleared?
                    starksm64

                    Yes, that is problem, what to do with the exception we saw.

                    • 7. Re: InterruptedException not being cleared?
                      dmlloyd

                      This trivial patch gets clears the interrupt status, tolerates interrupts, and then restores the interrupt status in a finally block. Is there a reason to not do it this way? Otherwise I'll commit it, if you give the OK. Of course the forums will mangle this, but...

                      Index: classloader/src/main/java/org/jboss/classloader/spi/base/ClassLoaderManager.java
                      ===================================================================
                      --- classloader/src/main/java/org/jboss/classloader/spi/base/ClassLoaderManager.java (revision 85240)
                      +++ classloader/src/main/java/org/jboss/classloader/spi/base/ClassLoaderManager.java (working copy)
                      @@ -185,133 +185,141 @@
                       * Process the next task
                       *
                       * @param thread the thread
                       * @param task the task
                       * @throws InterruptedException if it is interrupted
                       */
                       private static void nextTask(Thread thread, ClassLoadingTask task) throws InterruptedException
                       {
                      - boolean trace = log.isTraceEnabled();
                      - if (trace)
                      - log.trace("Next task thread=" + thread + " task=" + task);
                      -
                      - List<ThreadTask> taskList = loadTasksByThread.get(thread);
                      - synchronized (taskList)
                      + boolean intr = Thread.interrupted();
                      + try
                       {
                      - // There may not be any ThreadTasks
                      - while (taskList.isEmpty() && task.getThreadTaskCount() != 0 )
                      + boolean trace = log.isTraceEnabled();
                      + if (trace)
                      + log.trace("Next task thread=" + thread + " task=" + task);
                      +
                      + List<ThreadTask> taskList = loadTasksByThread.get(thread);
                      + synchronized (taskList)
                       {
                      - /* There are no more tasks for the calling thread to execute, so the
                      - calling thread must wait until the task.threadTaskCount reaches 0
                      - */
                      - if (trace)
                      - log.trace("Begin nextTask(WAIT_ON_EVENT), task="+task);
                      - try
                      + // There may not be any ThreadTasks
                      + while (taskList.isEmpty() && task.getThreadTaskCount() != 0 )
                       {
                      - task.waitOnEvent();
                      - taskList.wait();
                      + /* There are no more tasks for the calling thread to execute, so the
                      + calling thread must wait until the task.threadTaskCount reaches 0
                      + */
                      + if (trace)
                      + log.trace("Begin nextTask(WAIT_ON_EVENT), task="+task);
                      + try
                      + {
                      + task.waitOnEvent();
                      + taskList.wait();
                      + if (trace)
                      + log.trace("nextTask(WAIT_ON_EVENT), notified, task="+task);
                      + }
                      + catch(InterruptedException e)
                      + {
                      + if( trace )
                      + log.trace("nextTask(WAIT_ON_EVENT), interrupted, task="+task, e);
                      + intr = true;
                      + }
                       }
                      - catch(InterruptedException e)
                      +
                      + if (trace)
                      + log.trace("Continue nextTask(" + taskList.size()+"), task="+task);
                      +
                      + // See if the task is complete
                      + if (task.getThreadTaskCount() == 0)
                       {
                      - if( trace )
                      - log.trace("nextTask(WAIT_ON_EVENT), interrupted, task="+task, e);
                      - // Abort this task t
                      - throw e;
                      + task.finish();
                      + log.trace("End nextTask(FINISHED), task="+task);
                      + return;
                       }
                      - if (trace)
                      - log.trace("nextTask(WAIT_ON_EVENT), notified, task="+task);
                       }
                      
                      + ThreadTask threadTask = taskList.remove(0);
                      + ClassLoadingTask loadTask = threadTask.getLoadTask();
                       if (trace)
                      - log.trace("Continue nextTask(" + taskList.size()+"), task="+task);
                      + log.trace("Begin nextTask(" + taskList.size() + "), loadTask=" + loadTask);
                      
                      - // See if the task is complete
                      - if (task.getThreadTaskCount() == 0)
                      + try
                       {
                      - task.finish();
                      - log.trace("End nextTask(FINISHED), task="+task);
                      - return;
                      - }
                      - }
                      -
                      - ThreadTask threadTask = taskList.remove(0);
                      - ClassLoadingTask loadTask = threadTask.getLoadTask();
                      - if (trace)
                      - log.trace("Begin nextTask(" + taskList.size() + "), loadTask=" + loadTask);
                      -
                      - try
                      - {
                      - Thread taskThread = threadTask.getThread();
                      - if (taskThread == null)
                      - {
                      - /* This is a task that has been reassigned back to the original
                      - requesting thread ClassLoadingTask, so a new ThreadTask must
                      - be scheduled.
                      - */
                      - if (trace)
                      - log.trace("Rescheduling threadTask=" + threadTask);
                      - scheduleTask(loadTask, threadTask.getLoader(), true);
                      + Thread taskThread = threadTask.getThread();
                      + if (taskThread == null)
                      + {
                      + /* This is a task that has been reassigned back to the original
                      + requesting thread ClassLoadingTask, so a new ThreadTask must
                      + be scheduled.
                      + */
                      + if (trace)
                      + log.trace("Rescheduling threadTask=" + threadTask);
                      + scheduleTask(loadTask, threadTask.getLoader(), true);
                      + }
                      + else
                      + {
                      + if (trace)
                      + log.trace("Running threadTask=" + threadTask);
                      + threadTask.run();
                      + }
                       }
                      - else
                      + catch (Throwable e)
                       {
                       if (trace)
                      - log.trace("Running threadTask=" + threadTask);
                      - threadTask.run();
                      - }
                      - }
                      - catch (Throwable e)
                      - {
                      - if (trace)
                      - log.trace("Run failed with exception", e);
                      - boolean retry = e instanceof ClassCircularityError || e.getClass().equals(LinkageError.class);
                      - if (retry && loadTask.incrementNumCCE() < MAX_CCE)
                      - {
                      - /* Reschedule this task after all existing tasks to allow the
                      - current load tasks which are conflicting to complete.
                      - */
                      - try
                      + log.trace("Run failed with exception", e);
                      + boolean retry = e instanceof ClassCircularityError || e.getClass().equals(LinkageError.class);
                      + if (retry && loadTask.incrementNumCCE() < MAX_CCE)
                       {
                      - // Reschedule and update the loadTask.threadTaskCount
                      - scheduleTask(loadTask, threadTask.getLoader(), true);
                      + /* Reschedule this task after all existing tasks to allow the
                      + current load tasks which are conflicting to complete.
                      + */
                      + try
                      + {
                      + // Reschedule and update the loadTask.threadTaskCount
                      + scheduleTask(loadTask, threadTask.getLoader(), true);
                      + }
                      + catch (Throwable ex)
                      + {
                      + loadTask.setLoadError(ex);
                      + log.warn("Failed to reschedule task after CCE", ex);
                      + }
                      + if (trace)
                      + log.trace("Post CCE state, loadTask=" + loadTask);
                       }
                      - catch (Throwable ex)
                      + else
                       {
                      - loadTask.setLoadError(ex);
                      - log.warn("Failed to reschedule task after CCE", ex);
                      + loadTask.setLoadError(e);
                       }
                      - if (trace)
                      - log.trace("Post CCE state, loadTask=" + loadTask);
                       }
                      - else
                      + finally
                       {
                      - loadTask.setLoadError(e);
                      + // Release any lock on the classloader
                      + if (threadTask.isReleaseInNextTask())
                      + threadTask.getClassLoader().unlock(false);
                       }
                      - }
                      - finally
                      - {
                      - // Release any lock on the classloader
                      - if (threadTask.isReleaseInNextTask())
                      - threadTask.getClassLoader().unlock(false);
                      - }
                      
                      - // If the ThreadTasks are complete mark the ClassLoadingTask finished
                      - if (loadTask.getThreadTaskCount() == 0)
                      - {
                      - List<ThreadTask> loadTaskThreadTasks = loadTasksByThread.get(loadTask.getRequestingThread());
                      - synchronized (loadTaskThreadTasks)
                      + // If the ThreadTasks are complete mark the ClassLoadingTask finished
                      + if (loadTask.getThreadTaskCount() == 0)
                       {
                      - if( trace )
                      - log.trace("Notifying task of thread completion, loadTask:"+loadTask);
                      - task.finish();
                      - loadTaskThreadTasks.notify();
                      + List<ThreadTask> loadTaskThreadTasks = loadTasksByThread.get(loadTask.getRequestingThread());
                      + synchronized (loadTaskThreadTasks)
                      + {
                      + if( trace )
                      + log.trace("Notifying task of thread completion, loadTask:"+loadTask);
                      + task.finish();
                      + loadTaskThreadTasks.notify();
                      + }
                       }
                      + if (trace)
                      + log.trace("End nextTask(" + taskList.size()+ "), loadTask=" + loadTask);
                      + }
                      + finally
                      + {
                      + if (intr)
                      + Thread.currentThread().interrupt();
                       }
                      - if (trace)
                      - log.trace("End nextTask(" + taskList.size()+ "), loadTask=" + loadTask);
                       }
                      
                       /**
                       * Invoked to create a ThreadTask to assign a thread to the task of
                       * loading the class of ClassLoadingTask.
                       *
                       * @param task the classloading task
                       * @param loader the loader
                      


                      • 8. Re: InterruptedException not being cleared?
                        dmlloyd

                        There's another interrupt-eater down below in the same file, though this one I think was just a mistake of omission:

                        @@ -386,16 +394,17 @@
                         }
                         else
                         {
                         releaseInNextTask = true;
                         }
                         }
                         catch (InterruptedException ignored)
                         {
                        + interrupted = true;
                         }
                         thread = loadClassThreads.get(classLoader);
                         }
                         }
                         finally
                         {
                         if (interrupted)
                         Thread.currentThread().interrupt();
                        



                        • 9. Re: InterruptedException not being cleared?
                          starksm64

                          I think that looks ok, but we really need some tests to validate the expected behaviors for the ways multiple cooperating class loading threads can be interrupted.

                          • 10. Re: InterruptedException not being cleared?
                            dmlloyd

                            OK, I'll try to come up with one...

                            • 11. Re: InterruptedException not being cleared?
                              starksm64

                              It looks like somewhere along this stack trace is where the interrupt is being set. I'm not sure why.

                              13:30:16,400 INFO [RuntimeDiscoveryExecutor] Running runtime discovery scan rooted at platform...
                              13:30:26,199 ERROR [ExceptionUtil] Topic[/topic/TestTopic] getNonDurableSubscriptionsCount
                              java.lang.InterruptedException
                               at EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock$ReaderLock.acquire(WriterPreferenceReadWriteLock.java:157)
                               at org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.getQueuesForCondition(MessagingPostOffice.java:514)
                               at org.jboss.jms.server.destination.ManagedTopic.getSubscriptionsCount(ManagedTopic.java:308)
                               at org.jboss.jms.server.destination.ManagedTopic.getNonDurableSubscriptionsCount(ManagedTopic.java:104)
                               at org.jboss.jms.server.destination.TopicService.getNonDurableSubscriptionsCount(TopicService.java:305)
                               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                               at java.lang.reflect.Method.invoke(Method.java:585)
                               at org.jboss.mx.interceptor.AttributeDispatcher.invoke(AttributeDispatcher.java:99)
                               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                               at org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor.invoke(ModelMBeanAttributeInterceptor.java:197)
                               at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:76)
                               at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                               at org.jboss.mx.server.AbstractMBeanInvoker.getAttribute(AbstractMBeanInvoker.java:362)
                               at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:565)
                               at org.jboss.system.deployers.managed.ServiceMetaDataICF.getValue(ServiceMetaDataICF.java:166)
                               at org.jboss.system.deployers.managed.ServiceMetaDataICF.getValue(ServiceMetaDataICF.java:54)
                               at org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator.populateValues(AbstractManagedObjectPopulator.java:204)
                               at org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator.populateManagedObject(AbstractManagedObjectPopulator.java:130)
                               at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.initManagedObject(AbstractManagedObjectFactory.java:367)
                               at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.getManagedObjectValue(AbstractInstanceClassFactory.java:315)
                               at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.getManagedObjectArray(AbstractInstanceClassFactory.java:331)
                               at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.getValue(AbstractInstanceClassFactory.java:252)
                               at org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator.populateValues(AbstractManagedObjectPopulator.java:204)
                               at org.jboss.managed.plugins.factory.AbstractManagedObjectPopulator.populateManagedObject(AbstractManagedObjectPopulator.java:130)
                               at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.initManagedObject(AbstractManagedObjectFactory.java:367)
                               at org.jboss.deployers.spi.deployer.helpers.DefaultManagedObjectCreator.build(DefaultManagedObjectCreator.java:81)
                               at org.jboss.deployers.plugins.deployers.DeployersImpl.getManagedObjects(DeployersImpl.java:463)
                               at org.jboss.deployers.plugins.main.MainDeployerImpl.getManagedObjects(MainDeployerImpl.java:928)
                               at org.jboss.deployers.plugins.main.MainDeployerImpl.getManagedDeployment(MainDeployerImpl.java:905)
                               at org.jboss.profileservice.management.ManagementViewImpl.getManagedDeployment(ManagementViewImpl.java:1303)
                               at org.jboss.profileservice.management.ManagementViewImpl.loadProfile(ManagementViewImpl.java:215)
                               at sun.reflect.GeneratedMethodAccessor317.invoke(Unknown Source)
                               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                               at java.lang.reflect.Method.invoke(Method.java:585)
                               at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
                               at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
                               at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:99)
                               at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
                               at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
                               at org.jboss.remoting.Client.invoke(Client.java:1708)
                               at org.jboss.remoting.Client.invoke(Client.java:612)
                               at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                               at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                               at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
                               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                               at AOPProxy$1.loadProfile(AOPProxy$1.java)
                               at org.rhq.plugins.jbossas5.factory.ProfileServiceFactory.refreshCurrentProfileView(ProfileServiceFactory.java:113)
                               at org.rhq.plugins.jbossas5.ManagedDeploymentComponent.getManagedDeployment(ManagedDeploymentComponent.java:335)
                               at org.rhq.plugins.jbossas5.ManagedDeploymentComponent.getAvailability(ManagedDeploymentComponent.java:133)
                               at sun.reflect.GeneratedMethodAccessor330.invoke(Unknown Source)
                               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                               at java.lang.reflect.Method.invoke(Method.java:585)
                               at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:466)
                               at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
                               at java.util.concurrent.FutureTask.run(FutureTask.java:123)
                               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
                               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
                               at java.lang.Thread.run(Thread.java:613)
                              



                              • 12. Re: InterruptedException not being cleared?
                                dmlloyd

                                I'm not 100% sure this is testable. If it is, it's beyond my skill. It looks like there are some outer things which detect and defer interruption properly, but maybe some inner things aren't? There are some unit tests which interrupt the thread, and then load some classes, but they aren't tripping this problem. The other alternative is that those tests (in the "old" directory) just aren't exercising these methods at all. Still trying to figure it out...

                                • 13. Re: InterruptedException not being cleared?
                                  dmlloyd

                                  Ah, I see. In ClassLoaderManager:201, the task list is never empty in the unit test, so it never waits, and thus never triggers the error.

                                  No idea how to trick it into waiting though.

                                  • 14. Re: InterruptedException not being cleared?
                                    starksm64

                                    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.

                                    1 2 Previous Next