Skip to content

threadpool=cached can not recycle idle thread #8342

Open

Description

@ecyuan

Environment

  • Dubbo version: 2.7.5 / 2.7.12
  • Java version: JDK1.8

my dubbo config

dubbo.protocol.threads=5
dubbo.protocol.corethreads=2
dubbo.protocol.alive=15000
dubbo.protocol.threadpool=cached

I hope idle thread will be recycle after 15 seconds.

Invoke some service, jstack java process show as follow, 5 thread idle:
"Dubbo-thread-5" #108 daemon prio=5 os_prio=0 tid=0x0000000033e54000 nid=0x2410 waiting on condition [0x000000004761e000]
        at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
"Dubbo-thread-4" #107 daemon prio=5 os_prio=0 tid=0x0000000033e53800 nid=0x395c waiting on condition [0x000000004751f000]
        at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
"Dubbo-thread-3" #106 daemon prio=5 os_prio=0 tid=0x0000000033e51000 nid=0x3858 waiting on condition [0x000000004741e000]
        at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
"Dubbo-thread-2" #97 daemon prio=5 os_prio=0 tid=0x0000000033e4c800 nid=0x2210 waiting on condition [0x000000004637f000]
        at org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
"Dubbo-thread-1" #96 daemon prio=5 os_prio=0 tid=0x0000000033e47800 nid=0x12e8 waiting on condition [0x000000004526e000]

But after 15 seconds or more, these idle thread still alive, unexpectedly been recycled.

Activity

  1. xiaoheng1 commented on Jul 25, 2021

    @xiaoheng1
    Contributor

    Please check if the service is blocked.

  2. ecyuan commented on Jul 25, 2021

    @ecyuan
    Author

    Please check if the service is blocked.

    No! In fact there are no any more request. Maybe you can test in local host, it should be repeated again.

    Consider extending to use third-part thread pool component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions