Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4027

TransactionTable.start() initialize the TxCleanupService thread pool even when the cache is NON_TRANSACTIONAL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.0.0.CR2
    • 6.0.1.Final
    • None

    Description

      In the TransactionTable.start() each cache creates a thread pool and a job is scheduled to clean up completed transactions.

      private void start() {
            ...
            totalOrder = configuration.transaction().transactionProtocol().isTotalOrder();
            if (!totalOrder) {
               // Periodically run a task to cleanup the transaction table from completed transactions.
               ThreadFactory tf = new ThreadFactory() {
                  @Override
                  public Thread newThread(Runnable r) {
                     String address = rpcManager != null ? rpcManager.getTransport().getAddress().toString() : "local";
                     Thread th = new Thread(r, "TxCleanupService," + cacheName + "," + address);
                     th.setDaemon(true);
                     return th;
                  }
               };
      
               executorService = Executors.newSingleThreadScheduledExecutor(tf);
      
               long interval = configuration.transaction().reaperWakeUpInterval();
               executorService.scheduleAtFixedRate(new Runnable() {
                  @Override
                  public void run() {
                     cleanupCompletedTransactions();
                  }
               }, interval, interval, TimeUnit.MILLISECONDS);
            }
      }
      

      As you can see in the code, even is the cache is NON_TRANSACTIONAL the job is scheduled, consuming resources to do nothing (the completedTransactions map is always empty)

      Maybe I'm missing something, but our application profiling is showing us that these threads do nothing but they are consuming precious resources because we have more than 1000 NON_TRANSACTIONAL caches.

      This can be considered when solving ISPN-3702 too.

      Attachments

        Activity

          People

            rhn-support-tkimura Takayoshi Kimura
            ggarciao_jira Guillermo GARCIA OCHOA (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: