[jira] Created: (EXEC-55) Set names for started threads

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (EXEC-55) Set names for started threads

ASF GitHub Bot (Jira)
Set names for started threads
-----------------------------

                 Key: EXEC-55
                 URL: https://issues.apache.org/jira/browse/EXEC-55
             Project: Commons Exec
          Issue Type: Improvement
    Affects Versions: 1.1
            Reporter: Dominik Stadler
            Priority: Minor


Currently some threads are started without names, this makes it harder to read thread dumps, especially in large applications with many threads.

The following patch fixes this for the places that I could identify:

### Eclipse Workspace Patch 1.0
#P commons-exec-trunk
Index: src/main/java/org/apache/commons/exec/DefaultExecutor.java
===================================================================
--- src/main/java/org/apache/commons/exec/DefaultExecutor.java (revision 1071645)
+++ src/main/java/org/apache/commons/exec/DefaultExecutor.java (working copy)
@@ -181,7 +181,7 @@
             throw new IOException(workingDirectory + " doesn't exist.");
         }
 
-        executorThread = new Thread() {
+        executorThread = new Thread("Default Executor") {
             public void run() {
                 int exitValue = Executor.INVALID_EXITVALUE;
                 try {                    
Index: src/main/java/org/apache/commons/exec/PumpStreamHandler.java
===================================================================
--- src/main/java/org/apache/commons/exec/PumpStreamHandler.java (revision 1071645)
+++ src/main/java/org/apache/commons/exec/PumpStreamHandler.java (working copy)
@@ -284,7 +284,7 @@
     protected Thread createPump(final InputStream is, final OutputStream os,
             final boolean closeWhenExhausted) {
         final Thread result = new Thread(new StreamPumper(is, os,
-                closeWhenExhausted));
+                closeWhenExhausted), "Stream Pumper");
         result.setDaemon(true);
         return result;
     }
@@ -300,7 +300,7 @@
      */
     private Thread createSystemInPump(InputStream is, OutputStream os) {
         inputStreamPumper = new InputStreamPumper(is, os);
-        final Thread result = new Thread(inputStreamPumper);
+        final Thread result = new Thread(inputStreamPumper, "Input Stream Pumper");
         result.setDaemon(true);
         return result;
     }


--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (EXEC-55) Set names for started threads

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/EXEC-55?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dominik Stadler updated EXEC-55:
--------------------------------

    Description:
Currently some threads are started without names, this makes it harder to read thread dumps, especially in large applications with many threads.

The following patch fixes this for the places that I could identify:

{code}
### Eclipse Workspace Patch 1.0
#P commons-exec-trunk
Index: src/main/java/org/apache/commons/exec/DefaultExecutor.java
===================================================================
--- src/main/java/org/apache/commons/exec/DefaultExecutor.java (revision 1071645)
+++ src/main/java/org/apache/commons/exec/DefaultExecutor.java (working copy)
@@ -181,7 +181,7 @@
             throw new IOException(workingDirectory + " doesn't exist.");
         }
 
-        executorThread = new Thread() {
+        executorThread = new Thread("Default Executor") {
             public void run() {
                 int exitValue = Executor.INVALID_EXITVALUE;
                 try {                    
Index: src/main/java/org/apache/commons/exec/PumpStreamHandler.java
===================================================================
--- src/main/java/org/apache/commons/exec/PumpStreamHandler.java (revision 1071645)
+++ src/main/java/org/apache/commons/exec/PumpStreamHandler.java (working copy)
@@ -284,7 +284,7 @@
     protected Thread createPump(final InputStream is, final OutputStream os,
             final boolean closeWhenExhausted) {
         final Thread result = new Thread(new StreamPumper(is, os,
-                closeWhenExhausted));
+                closeWhenExhausted), "Stream Pumper");
         result.setDaemon(true);
         return result;
     }
@@ -300,7 +300,7 @@
      */
     private Thread createSystemInPump(InputStream is, OutputStream os) {
         inputStreamPumper = new InputStreamPumper(is, os);
-        final Thread result = new Thread(inputStreamPumper);
+        final Thread result = new Thread(inputStreamPumper, "Input Stream Pumper");
         result.setDaemon(true);
         return result;
     }
{code}


  was:
Currently some threads are started without names, this makes it harder to read thread dumps, especially in large applications with many threads.

The following patch fixes this for the places that I could identify:

### Eclipse Workspace Patch 1.0
#P commons-exec-trunk
Index: src/main/java/org/apache/commons/exec/DefaultExecutor.java
===================================================================
--- src/main/java/org/apache/commons/exec/DefaultExecutor.java (revision 1071645)
+++ src/main/java/org/apache/commons/exec/DefaultExecutor.java (working copy)
@@ -181,7 +181,7 @@
             throw new IOException(workingDirectory + " doesn't exist.");
         }
 
-        executorThread = new Thread() {
+        executorThread = new Thread("Default Executor") {
             public void run() {
                 int exitValue = Executor.INVALID_EXITVALUE;
                 try {                    
Index: src/main/java/org/apache/commons/exec/PumpStreamHandler.java
===================================================================
--- src/main/java/org/apache/commons/exec/PumpStreamHandler.java (revision 1071645)
+++ src/main/java/org/apache/commons/exec/PumpStreamHandler.java (working copy)
@@ -284,7 +284,7 @@
     protected Thread createPump(final InputStream is, final OutputStream os,
             final boolean closeWhenExhausted) {
         final Thread result = new Thread(new StreamPumper(is, os,
-                closeWhenExhausted));
+                closeWhenExhausted), "Stream Pumper");
         result.setDaemon(true);
         return result;
     }
@@ -300,7 +300,7 @@
      */
     private Thread createSystemInPump(InputStream is, OutputStream os) {
         inputStreamPumper = new InputStreamPumper(is, os);
-        final Thread result = new Thread(inputStreamPumper);
+        final Thread result = new Thread(inputStreamPumper, "Input Stream Pumper");
         result.setDaemon(true);
         return result;
     }



> Set names for started threads
> -----------------------------
>
>                 Key: EXEC-55
>                 URL: https://issues.apache.org/jira/browse/EXEC-55
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Dominik Stadler
>            Priority: Minor
>
> Currently some threads are started without names, this makes it harder to read thread dumps, especially in large applications with many threads.
> The following patch fixes this for the places that I could identify:
> {code}
> ### Eclipse Workspace Patch 1.0
> #P commons-exec-trunk
> Index: src/main/java/org/apache/commons/exec/DefaultExecutor.java
> ===================================================================
> --- src/main/java/org/apache/commons/exec/DefaultExecutor.java (revision 1071645)
> +++ src/main/java/org/apache/commons/exec/DefaultExecutor.java (working copy)
> @@ -181,7 +181,7 @@
>              throw new IOException(workingDirectory + " doesn't exist.");
>          }
>  
> -        executorThread = new Thread() {
> +        executorThread = new Thread("Default Executor") {
>              public void run() {
>                  int exitValue = Executor.INVALID_EXITVALUE;
>                  try {                    
> Index: src/main/java/org/apache/commons/exec/PumpStreamHandler.java
> ===================================================================
> --- src/main/java/org/apache/commons/exec/PumpStreamHandler.java (revision 1071645)
> +++ src/main/java/org/apache/commons/exec/PumpStreamHandler.java (working copy)
> @@ -284,7 +284,7 @@
>      protected Thread createPump(final InputStream is, final OutputStream os,
>              final boolean closeWhenExhausted) {
>          final Thread result = new Thread(new StreamPumper(is, os,
> -                closeWhenExhausted));
> +                closeWhenExhausted), "Stream Pumper");
>          result.setDaemon(true);
>          return result;
>      }
> @@ -300,7 +300,7 @@
>       */
>      private Thread createSystemInPump(InputStream is, OutputStream os) {
>          inputStreamPumper = new InputStreamPumper(is, os);
> -        final Thread result = new Thread(inputStreamPumper);
> +        final Thread result = new Thread(inputStreamPumper, "Input Stream Pumper");
>          result.setDaemon(true);
>          return result;
>      }
> {code}

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (EXEC-55) Set names for started threads

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Dominik Stadler commented on EXEC-55:
-------------------------------------

I see this has landed in trunk, is there anything still missing for this issue to be resolved?

> Set names for started threads
> -----------------------------
>
>                 Key: EXEC-55
>                 URL: https://issues.apache.org/jira/browse/EXEC-55
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Dominik Stadler
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>
> Currently some threads are started without names, this makes it harder to read thread dumps, especially in large applications with many threads.
> The following patch fixes this for the places that I could identify:
> {code}
> ### Eclipse Workspace Patch 1.0
> #P commons-exec-trunk
> Index: src/main/java/org/apache/commons/exec/DefaultExecutor.java
> ===================================================================
> --- src/main/java/org/apache/commons/exec/DefaultExecutor.java (revision 1071645)
> +++ src/main/java/org/apache/commons/exec/DefaultExecutor.java (working copy)
> @@ -181,7 +181,7 @@
>              throw new IOException(workingDirectory + " doesn't exist.");
>          }
>  
> -        executorThread = new Thread() {
> +        executorThread = new Thread("Default Executor") {
>              public void run() {
>                  int exitValue = Executor.INVALID_EXITVALUE;
>                  try {                    
> Index: src/main/java/org/apache/commons/exec/PumpStreamHandler.java
> ===================================================================
> --- src/main/java/org/apache/commons/exec/PumpStreamHandler.java (revision 1071645)
> +++ src/main/java/org/apache/commons/exec/PumpStreamHandler.java (working copy)
> @@ -284,7 +284,7 @@
>      protected Thread createPump(final InputStream is, final OutputStream os,
>              final boolean closeWhenExhausted) {
>          final Thread result = new Thread(new StreamPumper(is, os,
> -                closeWhenExhausted));
> +                closeWhenExhausted), "Stream Pumper");
>          result.setDaemon(true);
>          return result;
>      }
> @@ -300,7 +300,7 @@
>       */
>      private Thread createSystemInPump(InputStream is, OutputStream os) {
>          inputStreamPumper = new InputStreamPumper(is, os);
> -        final Thread result = new Thread(inputStreamPumper);
> +        final Thread result = new Thread(inputStreamPumper, "Input Stream Pumper");
>          result.setDaemon(true);
>          return result;
>      }
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (EXEC-55) Set names for started threads

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/EXEC-55?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl resolved EXEC-55.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.1

Fixed a while ago
               

> Set names for started threads
> -----------------------------
>
>                 Key: EXEC-55
>                 URL: https://issues.apache.org/jira/browse/EXEC-55
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.1
>            Reporter: Dominik Stadler
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.1.1
>
>
> Currently some threads are started without names, this makes it harder to read thread dumps, especially in large applications with many threads.
> The following patch fixes this for the places that I could identify:
> {code}
> ### Eclipse Workspace Patch 1.0
> #P commons-exec-trunk
> Index: src/main/java/org/apache/commons/exec/DefaultExecutor.java
> ===================================================================
> --- src/main/java/org/apache/commons/exec/DefaultExecutor.java (revision 1071645)
> +++ src/main/java/org/apache/commons/exec/DefaultExecutor.java (working copy)
> @@ -181,7 +181,7 @@
>              throw new IOException(workingDirectory + " doesn't exist.");
>          }
>  
> -        executorThread = new Thread() {
> +        executorThread = new Thread("Default Executor") {
>              public void run() {
>                  int exitValue = Executor.INVALID_EXITVALUE;
>                  try {                    
> Index: src/main/java/org/apache/commons/exec/PumpStreamHandler.java
> ===================================================================
> --- src/main/java/org/apache/commons/exec/PumpStreamHandler.java (revision 1071645)
> +++ src/main/java/org/apache/commons/exec/PumpStreamHandler.java (working copy)
> @@ -284,7 +284,7 @@
>      protected Thread createPump(final InputStream is, final OutputStream os,
>              final boolean closeWhenExhausted) {
>          final Thread result = new Thread(new StreamPumper(is, os,
> -                closeWhenExhausted));
> +                closeWhenExhausted), "Stream Pumper");
>          result.setDaemon(true);
>          return result;
>      }
> @@ -300,7 +300,7 @@
>       */
>      private Thread createSystemInPump(InputStream is, OutputStream os) {
>          inputStreamPumper = new InputStreamPumper(is, os);
> -        final Thread result = new Thread(inputStreamPumper);
> +        final Thread result = new Thread(inputStreamPumper, "Input Stream Pumper");
>          result.setDaemon(true);
>          return result;
>      }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira