[
http://issues.apache.org/jira/browse/HADOOP-327?page=comments#action_12420276 ]
Doug Cutting commented on HADOOP-327:
-------------------------------------
I agree with removing the call to exit(), but I don't see the need to change
the exception.
To my thinking, this replaces the standard main() signature:
public static void main(String[] args) throws Exception {
...
}
Folks frequently write main() to not throw anything, and then catch exceptions
and print the stacktrace. This just makes the code bigger, since the JVM
already prints the stack trace when a main() throws an exception. It also
makes it harder to call the main() programatically (which is ocassionally
useful) since you'll have no idea whether it has somehow failed. So this is
why I argue that main() routines should throw Exception, and analagously, why
our replacement should do the same. Otherwise we'll just have folks catching
other exceptions and repackaging them in IOException, adding pointless code.
> ToolBase calls System.exit
> --------------------------
>
> Key: HADOOP-327
> URL: http://issues.apache.org/jira/browse/HADOOP-327
> Project: Hadoop
> Type: Bug
> Components: util
> Versions: 0.4.0
> Reporter: Owen O'Malley
> Assignee: Hairong Kuang
> Fix For: 0.5.0
> Attachments: exit.patch
>
> The new ToolBase class calls System.exit when the main routine finishes. That
> will break if the application uses threads that need to finish before the jvm
> exits. The normal semantics is that the program doesn't finish execution
> until all of the non-daemon threads exit (including the main one) and
> System.exit should never be called except for critical errors.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira