Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-1177

The Connector will blocked when execute dispose, And multiple threads are leaking

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.13
    • None
    • Core
    • None

    Description

      In an old project, a RpcClient using mina 2.0.13 version has a memory leak. After investigation, it was found that many NioProcessor and NioSocketConnector were not recycled, and the number of threads was continuously increasing (the traffic did not increase).

      Below is the RpcClient code used in the project. After reading, I also found some problems:

      RpcClien3.java

      new RpcClient3().start();

      1.session close is not right

      RpcClient#close()
      
      future.getSession().close(false);
      // this future is ConnectFuture,not CloseFuture
      futureUInterrupt = future.awaitUninterruptibly(CONNECTOR_WORKER_TIMEOUT);
      
      

      2.RpcClient#close has concurrent calls 

      1.RpcClient#startHealthCheck
      2.RpcClient#activateConnectionSensor

       

      But I still can't reproduce this problem, My leader want to locate the problem as much as possible before trying on the prod environment, such as updating the version, modifying session close to future.getSession().close(true) and wait().

      ps: The heap.prof  file cannot be uploaded as it exceeds 60MB.  this is a google drive link: https://drive.google.com/file/d/14UBnhAF-7sdfYJsh7FMfKxx-dm0BqU9t/view?usp=drive_link

      Attachments

        1. image-2024-01-08-16-53-27-846.png
          220 kB
          Vegeta
        2. image-2024-01-08-16-54-02-222.png
          189 kB
          Vegeta
        3. image-2024-01-08-16-58-34-700.png
          291 kB
          Vegeta
        4. RpcClien3.java
          16 kB
          Vegeta
        5. stack_2023-07-02_22.log
          1.52 MB
          Vegeta

        Activity

          People

            Unassigned Unassigned
            vegeta Vegeta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: