Environment
Situation
Resolution
The Deployment Service performs many operations like checking for the any new rule to process, Rule evaluation, package deployment etc. in different threads.
The following are the different threads running under DS which needs to be set to halt before stopping DS:
- Heartbeat engine updates the status of DS into CCDB
- Detection engine is responsible for Rule evaluation and Task creation
- Delivery engine is responsible for deploying the modules to Target machines.
In the current DS design, the delivery engine cannot be stopped if some task is in active state. This is causing the DS to wait before shutdown until it completes its task.
If we are processing some rule (detection engine), we check regularly for “Should quit early” (“_StopLight.MustStop = true” flag). If we find it true then we stop processing further.
When we stop Deployment Service (DS) it waits until all of its child threads completes or reached some logical end on their task.
So when we stop Deployment Service (DS) it will exit only when currently running process finish.