You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Jun Yuan (Jira)" <ji...@apache.org> on 2021/09/24 13:39:00 UTC

[jira] [Commented] (IOTDB-1732) check the logic of stop() and shutdown() in IoTDB.java

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

Jun Yuan commented on IOTDB-1732:
---------------------------------

Define the usage scenarios first, for example, when load is high or for certain maintenance, iotdb needs to 'stop' receiving any user request (except admin request), but the existing running jobs are still running to finish; 'shutdown' is more like to wrap up existing jobs and shutdown the process with proper releasing of resources (the difference between shutdown and kill is resource releasing)

> check the logic of stop() and shutdown() in IoTDB.java
> ------------------------------------------------------
>
>                 Key: IOTDB-1732
>                 URL: https://issues.apache.org/jira/browse/IOTDB-1732
>             Project: Apache IoTDB
>          Issue Type: Task
>          Components: Core/Server
>            Reporter: Xiangdong Huang
>            Priority: Major
>
> Currently, IoTDB's stop() function and shutdown() function has different logic:
>  
> {code:java}
> @Override
>   public void stop() {
>     deactivate();
>   }
> private void deactivate() {
>     logger.info("Deactivating IoTDB...");
>     // some user may call Tracing on but do not close tracing.
>     // so, when remove the system, we have to close the tracing
>     if (IoTDBDescriptor.getInstance().getConfig().isEnablePerformanceTracing()) {
>       TracingManager.getInstance().close();
>     }
>     PrimitiveArrayManager.close();
>     SystemInfo.getInstance().close();
>     registerManager.deregisterAll();
>     JMXService.deregisterMBean(mbeanName);
>     logger.info("IoTDB is deactivated.");
>   }
>   public void shutdown() throws Exception {
>     //TODO shutdown is not equal to stop()
>     logger.info("Deactivating IoTDB...");
>     if (IoTDBDescriptor.getInstance().getConfig().isEnablePerformanceTracing()) {
>       TracingManager.getInstance().close();
>     }
>     registerManager.shutdownAll();
>     PrimitiveArrayManager.close();
>     SystemInfo.getInstance().close();
>     JMXService.deregisterMBean(mbeanName);
>     logger.info("IoTDB is deactivated.");
>   }
> {code}
>  
> We need to define the behavior clear: when to use stop and when to use shutdown? what is the difference?
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)