streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfranklin <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 143
Date Thu, 14 Aug 2014 18:29:19 GMT
Github user mfranklin commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/66#discussion_r16256675
  
    --- Diff: streams-util/src/main/java/org/apache/streams/util/ComponentUtils.java ---
    @@ -58,21 +83,23 @@ public static String pollUntilStringNotEmpty(Queue queue) {
             return result;
         }
     
    +    /**
    +     * Attempts to safely {@link java.util.concurrent.ExecutorService#shutdown()} and
{@link java.util.concurrent.ExecutorService#awaitTermination(long, java.util.concurrent.TimeUnit)}
    +     * of an {@link java.util.concurrent.ExecutorService}.
    +     * @param stream service to be shutdown
    +     * @param initialWait time in seconds to wait for currently running threads to finish
execution
    +     * @param secondaryWait time in seconds to wait for running threads that did not
terminate in the first wait to acknowledge their forced termination
    +     */
         public static void shutdownExecutor(ExecutorService stream, int initialWait, int
secondaryWait) {
    -        stream.shutdown(); // Disable new tasks from being submitted
    +        stream.shutdown();
             try {
    -            // Wait a while for existing tasks to terminate
                 if (!stream.awaitTermination(initialWait, TimeUnit.SECONDS)) {
    -                stream.shutdownNow(); // Cancel currently executing tasks
    --- End diff --
    
    Why remove the ShutdownNow call?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message