Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-34670

The asyncOperationsThreadPool in SubtaskCheckpointCoordinatorImpl can only create one worker thread

    XMLWordPrintableJSON

Details

    Description

      Now, the asyncOperations ThreadPoolExecutor of SubtaskCheckpointCoordinatorImpl is create with a LinkedBlockingQueue and zero corePoolSize.

      And in the ThreadPoolExecutor, except for the first time the task is submitted, no new thread is created until the queue is full. But the capacity of LinkedBlockingQueue is Integer.Max. This means that there is almost only one thread working in this thread pool, even if there are many concurrent checkpoint requests or checkpoint abort requests waiting to be processed.

      This problem can be verified by changing ExecutorService implementation in UT 
      SubtaskCheckpointCoordinatorTest#testNotifyCheckpointAbortedDuringAsyncPhase. When the LinkedBlockingQueue and zero corePoolSize are configured, this UT will deadlock because only one worker thread can be created.

      Attachments

        1. image-2024-03-14-20-33-28-851.png
          830 kB
          Jinzhong Li
        2. image-2024-03-14-20-27-37-540.png
          761 kB
          Jinzhong Li
        3. image-2024-03-14-20-24-14-198.png
          600 kB
          Jinzhong Li

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lijinzhong Jinzhong Li
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: