Currently ThreadGroup.stop() would stop both timers and threads
immediately.
However, heat-engine should stop timers before threads finished for
the purpose of graceful shutdown.
The graceful shutdown for Heat is "do process exit after stack
processing finished". Heat implemented the stack processing as threads.
We should wait its finishing for graceful shutdown's purpose.
On the one hand, Heat is using timers.
The timers have the function of make another job threads.
It means, we should stop timers before waiting threads for preventing
another thread occur by timers.
From the above, the appropriate order of Heat's graceful shutdown is:
* stop timers for preventing new thread occur
* wait for all threads to be finished
* process exit
However, currently ThreadGroup class doesn't have the function of
graceful stop. So I propose the function of graceful stop.
Conflicts:
tests/unit/test_threadgroup.py
Change-Id: Id575674af95ae7ad88c00a2ac5d629ab0d0a9b46
Closes-bug: #1304244
(cherry picked from commit fdc88831e272dec25ed77a176e6bdfb9cddb6c3d)
Reviewed: https:/ /review. openstack. org/96494 /git.openstack. org/cgit/ openstack/ oslo-incubator/ commit/ ?id=3f830bfd8c7 0a237aa5c38abfa 27c18e286289e2
Committed: https:/
Submitter: Jenkins
Branch: stable/icehouse
commit 3f830bfd8c70a23 7aa5c38abfa27c1 8e286289e2
Author: Mitsuru Kanabuchi <email address hidden>
Date: Thu Apr 17 11:31:46 2014 +0900
Add graceful stop function to ThreadGroup.stop
Currently ThreadGroup.stop() would stop both timers and threads
immediately.
However, heat-engine should stop timers before threads finished for
the purpose of graceful shutdown.
The graceful shutdown for Heat is "do process exit after stack
processing finished". Heat implemented the stack processing as threads.
We should wait its finishing for graceful shutdown's purpose.
On the one hand, Heat is using timers.
The timers have the function of make another job threads.
It means, we should stop timers before waiting threads for preventing
another thread occur by timers.
From the above, the appropriate order of Heat's graceful shutdown is:
* stop timers for preventing new thread occur
* wait for all threads to be finished
* process exit
However, currently ThreadGroup class doesn't have the function of
graceful stop. So I propose the function of graceful stop.
Conflicts: unit/test_ threadgroup. py
tests/
Change-Id: Id575674af95ae7 ad88c00a2ac5d62 9ab0d0a9b46 25ed77a176e6bdf b9cddb6c3d)
Closes-bug: #1304244
(cherry picked from commit fdc88831e272dec