[ 
http://jira.codehaus.org/browse/MEXEC-18?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87431
 ] 

Jerome Lacoste commented on MEXEC-18:
-------------------------------------

Is there really a need to interrupt the daemon threads ?

I've made some basic tests with the following code, and it looks like the VM is 
never interrupting daemon threads, just ignoring them.

class Test {

  public static void main(String[] args) {
    Thread t = new Thread(new Runnable() {
      public void run() {
        try {
          System.out.println("waiting");
          synchronized(this) {
            this.wait();
          }
        } catch (InterruptedException e) {
          System.err.println("interrupted");
        }
        System.out.println("exiting...");
      }
    });
    t.setDaemon(true);
    t.start();
    // wait for thread to start
    try {
      System.out.println("sleeping");
      Thread.currentThread().sleep(500);
    } catch (InterruptedException e) {
      System.out.println("main interrupted");
    }
    System.out.println("done");
  }
}

So it looks like we can just change the code to ignore the non daemon threads. 
That will remove the configuration options. I prefer that.

> un-stopped damean threads prevent plugin shutdown
> -------------------------------------------------
>
>                 Key: MEXEC-18
>                 URL: http://jira.codehaus.org/browse/MEXEC-18
>             Project: Mojo Exec Plugin
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: using latest snapshot
>            Reporter: Ryan Sonnek
>
> my application is using daemon threads, and the exec:java plugin just hangs.
> {noformat}
> [DEBUG] interrupting thread Thread[Lazy 
> Clock,1,com.digitalriver.schedule.JobRunner]
> [DEBUG] joining on thread Thread[Lazy 
> Clock,1,com.digitalriver.schedule.JobRunner]
> {noformat}
> since these are daemon threads, the exec:java plugin should try to 
> interrupt/join, but exit cleanly without worrrying about them.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to