Uploaded image for project: 'Hadoop Distributed Data Store'
  1. Hadoop Distributed Data Store
  2. HDDS-377

Make the ScmClient closable and stop the started threads

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.2.1
    • Component/s: SCM Client
    • Labels:
      None

      Description

      Current ScmClient class opens additional threads which won't be closed. For example SCMCLI can't stop because of this running thread:

      "nioEventLoopGroup-2-1" #15 prio=10 os_prio=0 tid=0x00007f1c84c74800 nid=0x77f4 runnable [0x00007f1c52238000]
         java.lang.Thread.State: RUNNABLE
      	at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
      	at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
      	at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
      	at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
      	- locked <0x0000000771adf7b0> (a org.apache.ratis.shaded.io.netty.channel.nio.SelectedSelectionKeySet)
      	- locked <0x0000000771ae12d8> (a java.util.Collections$UnmodifiableSet)
      	- locked <0x0000000771ae1010> (a sun.nio.ch.EPollSelectorImpl)
      	at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
      	at org.apache.ratis.shaded.io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)
      	at org.apache.ratis.shaded.io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:753)
      	at org.apache.ratis.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:409)
      	at org.apache.ratis.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
      	at org.apache.ratis.shaded.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
      	at java.lang.Thread.run(Thread.java:745)
      
      

      (Note this is netty, but the Grpc based xceiver also have some special threads).

      I propose to make ScmClient auto-closable and stop the XceiverClientManager in case of close.

        Attachments

        1. HDDS-377.001.patch
          2 kB
          Marton Elek

          Activity

            People

            • Assignee:
              elek Marton Elek
              Reporter:
              elek Marton Elek
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: