diff --git a/oslo_service/threadgroup.py b/oslo_service/threadgroup.py index e57efb52..51a0711c 100644 --- a/oslo_service/threadgroup.py +++ b/oslo_service/threadgroup.py @@ -16,6 +16,7 @@ import logging import threading import warnings +from debtcollector import removals import eventlet from eventlet import greenpool @@ -374,9 +375,14 @@ class ThreadGroup(object): return True return False + @removals.remove(removal_version='?') def cancel(self, *throw_args, **kwargs): """Cancel unstarted threads in the group, and optionally stop the rest. + .. warning:: + This method is deprecated and should not be used. It will be + removed in a future release. + If called without the ``timeout`` argument, this does **not** stop any running threads, but prevents any threads in the group that have not yet started from running, then returns immediately. Timers are not diff --git a/releasenotes/notes/threadgroup-cancel-bd89d72f383a3d9b.yaml b/releasenotes/notes/threadgroup-cancel-bd89d72f383a3d9b.yaml new file mode 100644 index 00000000..b37c925f --- /dev/null +++ b/releasenotes/notes/threadgroup-cancel-bd89d72f383a3d9b.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The ``ThreadGroup.cancel()`` method is deprecated and will be removed in a + future major release. diff --git a/requirements.txt b/requirements.txt index 4afebff0..ecca3594 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ # process, which may cause wedges in the gate later. WebOb>=1.7.1 # MIT +debtcollector>=1.2.0 # Apache 2.0 eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT fixtures>=3.0.0 # Apache-2.0/BSD greenlet>=0.4.10 # MIT