diff options
author | Gabriel Amram <gabriel@amram.co> | 2017-07-10 21:21:49 +0300 |
---|---|---|
committer | Omer Katz <omer.drow@gmail.com> | 2017-07-10 21:21:49 +0300 |
commit | b2f21289284496efd89acea003ff9c24105b970e (patch) | |
tree | bd81bab357f3150cc2977e6f14692612bb768f75 /Changelog | |
parent | ad54980ddb63e22e10c0ba66773db6c5e53e497b (diff) | |
download | kombu-b2f21289284496efd89acea003ff9c24105b970e.tar.gz |
Fix infinite loop in create_loop (#760)
* Fix infinite loop in create_loop
fixes https://github.com/celery/celery/issues/3712
Before handling the todo items we "freeze" them by copying them aside and clearing the list.
This way if an item in the todo list appends a new callable to the list itself it will be taken care of in the next iteration of the parent loop instead of producing an infinite loop by adding it to the list we're running on.
* Changed the test to be aligned with the new implementation
* passing flake8
* Avoid copying results with each iteration of the async loop.
* Pop instead of slicing.
* fixed: todos -> todo, fixed test to use MagicMock so we can use the len() method
* MagicMock not supported in 2.7, implemented __len__ on Mock instead
* added entry to changelog
Diffstat (limited to 'Changelog')
-rw-r--r-- | Changelog | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -15,6 +15,9 @@ Contributed by **Mikhail Elovskikh**. +- Async hub: Fixed potential infinite loop while performing todo tasks + (Issue celery/celery#3712). + .. _version-4.0.2: 4.0.2 |