Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1868

JVM waits for Spacelift's cached threads to timeout causing its termination delay

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • spacelift_1.0.0.Alpha2
    • Extension - Spacelift
    • None

      In the current implementation of ExecutorService there is this constructor:;

      public ExecutionServiceImpl() {
          this.service = Executors.newCachedThreadPool();
          this.scheduledService = Executors.newScheduledThreadPool(1);
      }
      

      JavaDoc for cachedThreadPool says:

      Threads that have not been used for sixty seconds are terminated and removed from the cache. Thus, a pool that remains idle for long enough will not consume any resources.

      While this is indeed useful, it seems that even JVM has nothing to do, it waits for these cached threads to timeout (so they are not used some time (60 seconds by default) so they are destroyed eventually) and only after their destruction whole JVM terminates properly.

      Please consider to lower the timeout so user does not have to wait or figure out other pooling mechanism.

      This issue effects mainly command line tools which hangs without obvious reason and debugging it why is a nightmare.

            Unassigned Unassigned
            smikloso Stefan Miklosovic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: