Hi This is to discuss on $subject. Why stratos need to support graceful shutdown is that when an instance wants to perform any cleaning up task before the actual termination, then we can add a termination hook in the stratos and let the instances to clean the data before the termination.
Here is what i suggest as the propose approach to implement this: - when Autoscaler takes the decision to terminate an instance, it can call SM to notify the instances via instance-notifier. - SM send the cleanup notification the topic - Member will receive the event and check the member filter to perform the cleanup task - Member will send the ReadyToShutDown event to instance-status topic once it is done with the cleaning up - CC will receive the event and perform the actual termination of the member. FYI: Graceful shutdown can be performed only when scaling down the instances or unsubscribe. But autoscaler can't call the SM to notify in other cases like instance crashed, agent crashed and application crashed, since the instance won't be in a good state to clean up the data. But later, if we specifically identify application crashed, then we can do cleaning up for application crashed case. Thanks, Reka -- Reka Thirunavukkarasu Software Engineer, WSO2, Inc.:http://wso2.com, Mobile: +94776442007
