You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/06/19 06:40:17 UTC

[GitHub] [shardingsphere-elasticjob-lite] Technoboy- edited a comment on pull request #781: Remove instance node in register server when shutdown (#780)

Technoboy- edited a comment on pull request #781:
URL: https://github.com/apache/shardingsphere-elasticjob-lite/pull/781#issuecomment-646456122


   First, I would like to describe how to reproduce this problem. 
   ```
   1. Using spring context to start the application with calling classPathXmlApplicationContext.registerShutdownHook();
   If not call this method, the issue could be reproduced.
   2. Then try to shutdown the application.
   3. List the zk path, you will see the children nodes of instances are not deleted.
   ls /namespace/jobname/instances
   ```
   Second, why does call registerShutdownHook will not delete instance children nodes?
   Because, if application registered spring shutdown hook, it will call shutdown method of JobRegistry and remove CoordinatorRegistryCenter before JobShutdownHookPlugin#shutdown. That means it won't call 'new InstanceService(regCenter, jobName).removeInstance();' in the  JobShutdownHookPlugin#shutdown.
   Last, I think this pr is an improvement. For current implementation, children nodes of instances are EPHEMERAL,  as the process shutdown,  even though it's not deleted actively, but it can be removed by zookeeper due to session timeout.
   Please check .


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org