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

James Taylor commented on PHOENIX-4113:
---------------------------------------

The problem I saw in the past in letting the shutdown hooks run is that they 
hang. 

bq. If OS is not able to clean up these orphaned resources soon enough, it 
could cause subsequent new JVM processes to run into resource issues.
When a process dies, the OS is pretty good about cleaning up resources.

Do you see different/better results when you make this change? If not, I don't 
think we should make it.

> Killing forked JVM may cause resources to be not released
> ---------------------------------------------------------
>
>                 Key: PHOENIX-4113
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4113
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>            Assignee: Samarth Jain
>         Attachments: PHOENIX-4113_4.x-HBase-0.98_v2.patch
>
>
> We have a <shutdown>kill</shutdown> configured in pom which behind the scenes 
> calls 
> {code}
> java.lang.Runtime.halt(1)
> {code}
> We also have a shutdown hook which is calling halt on the JVM.
> {code}
> private static String checkClusterInitialized(ReadOnlyProps serverProps) 
> throws Exception {
>         if (!clusterInitialized) {
>             url = setUpTestCluster(config, serverProps);
>             clusterInitialized = true;
>             Runtime.getRuntime().addShutdownHook(new Thread() {
>                 @Override
>                 public void run() {
>                     logger.info("SHUTDOWN: halting JVM now");
>                     Runtime.getRuntime().halt(0);
>                 }
>             });
>         }
>         return url;
>     }
> {code}
> This causes JVM to not execute all shutdown hooks which in turn would cause 
> the JVM process to not release all the system resources (network ports, file 
> handles, etc) it was using. If OS is not able to clean up these orphaned 
> resources soon enough, it could cause subsequent new JVM processes to run 
> into resource issues.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to