You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Grzegorz Grzybek (JIRA)" <ji...@apache.org> on 2017/08/30 06:29:00 UTC

[jira] [Commented] (KARAF-5327) Threads not stopped on karaf.restart + bundle(0).stop()

    [ https://issues.apache.org/jira/browse/KARAF-5327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16146704#comment-16146704 ] 

Grzegorz Grzybek commented on KARAF-5327:
-----------------------------------------

on each restart I have another server socket opened for shutdown thread:
{noformat}
[ggrzybek@everfree] ~/sources/github.com/apache/karaf 
$ ss -lntp|grep 13813
LISTEN     0      1            *:5005                     *:*                   users:(("java",pid=13813,fd=37))
LISTEN     0      1         ::ffff:127.0.0.1:46817                   :::*                   users:(("java",pid=13813,fd=54))
LISTEN     0      1         ::ffff:127.0.0.1:34211                   :::*                   users:(("java",pid=13813,fd=118))
LISTEN     0      50          :::8101                    :::*                   users:(("java",pid=13813,fd=132))
LISTEN     0      1         ::ffff:127.0.0.1:41317                   :::*                   users:(("java",pid=13813,fd=115))
LISTEN     0      50        ::ffff:127.0.0.1:1099                    :::*                   users:(("java",pid=13813,fd=123))
LISTEN     0      50          :::32849                   :::*                   users:(("java",pid=13813,fd=31))
LISTEN     0      1         ::ffff:127.0.0.1:45879                   :::*                   users:(("java",pid=13813,fd=105))
LISTEN     0      50        ::ffff:127.0.0.1:44444                   :::*                   users:(("java",pid=13813,fd=125))
LISTEN     0      1         ::ffff:127.0.0.1:37053                   :::*                   users:(("java",pid=13813,fd=114))
{noformat}


> Threads not stopped on karaf.restart + bundle(0).stop()
> -------------------------------------------------------
>
>                 Key: KARAF-5327
>                 URL: https://issues.apache.org/jira/browse/KARAF-5327
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 4.2.0
>            Reporter: Grzegorz Grzybek
>            Assignee: Grzegorz Grzybek
>
> I was looking at:
> {noformat}
> karaf@root()> system:property karaf.restart true
> karaf@root()> stop 0
> {noformat}
> I expected OSGi/Felix to be stopped, start-level go to 0 and all components/services/threads be stopped.
> However when Karaf came to:
> {noformat}
> "main@7301" prio=5 tid=0x1 nid=NA runnable
>   java.lang.Thread.State: RUNNABLE
> 	  at org.apache.karaf.main.Main.main(Main.java:170)
> {noformat}
> i.e., when Karaf decided to loop instead of System.exit() (because of karaf.restart=true), I saw the following threads remaining:
> * jline
> {noformat}
> "JLine terminal non blocking reader thread@7394" daemon prio=5 tid=0x5e nid=NA runnable
>   java.lang.Thread.State: RUNNABLE
> 	  at java.io.FileInputStream.readBytes(FileInputStream.java:-1)
> 	  at java.io.FileInputStream.read(FileInputStream.java:255)
> 	  at org.jline.utils.InputStreamReader.read(InputStreamReader.java:270)
> 	  - locked <0x1ce3> (a java.io.FileInputStream)
> 	  at org.jline.utils.InputStreamReader.read(InputStreamReader.java:200)
> 	  at org.jline.utils.NonBlockingReader.run(NonBlockingReader.java:276)
> 	  at java.lang.Thread.run(Thread.java:748)
> {noformat}
> * shutdown socket thread
> {noformat}
> "Karaf Shutdown Socket Thread@7393" daemon prio=5 tid=0x18 nid=NA runnable
>   java.lang.Thread.State: RUNNABLE
> 	  at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:-1)
> 	  at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
> 	  at java.net.ServerSocket.implAccept(ServerSocket.java:545)
> 	  at java.net.ServerSocket.accept(ServerSocket.java:513)
> 	  at org.apache.karaf.main.ShutdownSocketThread.run(ShutdownSocketThread.java:57)
> {noformat}
> (In fabric8v1 I also saw jetty threads running, but it's pax-web fault).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)