2 Replies Latest reply: Aug 3, 2011 6:10 AM by Bernd Zeitler RSS

Non-daemon threads running when using Deploymentmanager in JBoss 6

Bernd Zeitler Expert

I used the deployment manager to realize deployment/undeployment with ANT. This example code worked fine with JBoss 5 but has problems with JBoss 6:

 

    final Context ctx = new InitialContext();
    final DeploymentManager dm = (DeploymentManager) ctx.lookup("DeploymentManager");
    dm.distribute("thejar", new URL("file:./testdist/hello.jar"), true).run();
    dm.prepare("thejar").run();
    dm.start("thejar");
    dm.stop("thejar").run();
    dm.remove("thejar");

 

In real life, the deployment progress is evaluated and deployment status is checked after every call to the deployment manager

 

Deployment and undeployment still work as expected, but this code now leaves two non-daemon threads running. Both are threads from jboss remoting, a worker thread and an accecptor thread.

 

Did I miss something?

 

Regards,

 

Bernd

 

 

  • 1. Re: Non-daemon threads running when using Deploymentmanager in JBoss 6
    Emanuel Muckenhuber Master

    Hmm interesting. I guess that distribute with copyContent=false does not have that effect? As far as i remember jboss remoting opens some sort of streaming server when distributing the content. However i would expect that to be cleaned up after the content distribution is finished.

  • 2. Re: Non-daemon threads running when using Deploymentmanager in JBoss 6
    Bernd Zeitler Expert

    I investigated a bit more this morning...

     

    Your are right: it only happens with copy contents is set to true.

     

    When the content has been copied, the remoting client, which is starting a {{StreamServer}} instance, is closed, but the {{StreamServer}} is still alive. It doesn't get the StreamHandler.CLOSE from the server side and the connector is not stopped explicitly on client side, even if client.close() is invoked after every action called on the {{StreamingDeploymentTarget}}.

     

    The {{StreamServer}} will be removed upon finalization...

     

    I don't know for now, if the client side (deployment) is responsible for closing the {{StreamServer}} or if this is something that came with jboss remoting 2.5.3 .

     

    Other remoting threads are daemon threads, but I think, making the {{AcceptThreab}} daemon would only heal the symptom...