summaryrefslogtreecommitdiff
path: root/taskflow/retry.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove sixTakashi Kajinami2022-05-181-4/+2
| | | | | | | | This library no longer supports Python 2, thus usage of six can be removed. This also removes workaround about pickle library used in Python 2 only. Change-Id: I19d298cf0f402d65f0b142dea0bf35cf992332a9
* Refactor Atom/BaseTask/Task/Retry class hierarchyGreg Hill2016-02-181-7/+4
| | | | | | | | * Moved common argument mapping logic to Atom * Removed BaseTask * Removed duplicated logic from subclasses Change-Id: I275745adb80cecb0c35c1230eac76436bf3b0157
* Add optional 'defer_reverts' behaviorGreg Hill2015-11-171-4/+16
| | | | | | | | | | | This makes it possible to REVERT a subflow and have it also revert the parent flow if the parent flow doesn't have its own retry strategy. We will probably want to make this new behavior the default or only behavior in a future release. Change-Id: Iea5ac366380ba7396a87d0185703549fb0c2f825
* Document more of the retry subclasses special keyword argumentsJoshua Harlow2015-06-151-1/+38
| | | | Change-Id: Iaa3949da61c95ffe697fd80cef3ee8a6febd2a8c
* Adding a revert_all option to retry controllersMin Pae2015-06-111-5/+26
| | | | | | | | | | | | | When a retry controller is added to a nested flow, with the exception of AlwaysRetryAll, existing retry controllers do not cause a revert of predecessor tasks in the surrounding flow. This is due to the fact that these retry controllers always return RETRY. The revert_all option, when set True, will result in the retry controller returning REVERT_ALL rather than REVERT, which will cause predecessor tasks in the surrounding flow to also be REVERTed. Change-Id: I2d867b2d05e8559121ec48fd7249f15078450532
* Use the enum library for the retry strategy enumerationsJoshua Harlow2015-02-191-12/+36
| | | | | | | | | | | | | | | Instead of having a set of string constants that are the retry strategy/decision result have it instead be an enumerator that can be more clearly associated in docs and in code that these values are explicitly the strategies that the retry code can use (making it more obvious to users of these constants what they are for). This also updates the retry docs to use this new linkable class when describing the various strategies that can be used/returned. Change-Id: I944e521562be26f5315d7553da8d5820fc284c49
* Merge "Add a history retry object, makes retry histories easier to use"Jenkins2014-12-181-2/+65
|\
| * Add a history retry object, makes retry histories easier to useJoshua Harlow2014-11-191-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | When a retry object is asked to make a decision about the atoms it controls it is currently provided a complex object that contains what has failed and why and what was provided to try to resolve this failure as raw types. To make it easier to interact with that history provide and use a more easier to interact with helper object that provides useful functionality built ontop of the raw types. Part of blueprint intuitive-retries Change-Id: I93f86552f5a0c26b269319e4de6d9b8fb3b3b219
* | Add and use a new simple helper logging moduleJoshua Harlow2014-12-081-3/+0
|/ | | | | | | | | Add a new logging BLATHER level to easily allow its usage for messages that are below the normal DEBUG level such as compilation information and scope lookup info which can be very verbose in logs if always enabled. Change-Id: I828211403bd02bfd6777b10cdcfe58fb0637a52c
* Use constants for retry automatically provided kwargsJoshua Harlow2014-10-191-1/+10
| | | | | | | | | | | Instead of using strings use module level constants for the automatically provided keyword arguments to the retry revert/execution functions. This makes it easier for users of taskflow to associate these constants with the actual keywords, without having to resort to using raw strings directly. Change-Id: I739a0ad69819c3ca0d10c98966012cf9ef1b86bd
* Document more function/class/method paramsJoshua Harlow2014-09-261-37/+39
| | | | | | | | | | To help fill out the docs start adding on docstrings that document what a parameter is and what its meaning and usage is to help users better understand the parameter. Part of ongoing bug 1374202 Change-Id: I9f9a83cfb763a0a05d22efca4e0f80627ba8ca8f
* Upgrade hacking version and fix some of the issuesJoshua Harlow2014-06-131-27/+51
| | | | | | | | | | | | | | | | | Update hacking to the new requirements version and fix about half of the new reported issues. The other hacking issues are for now ignored until fixed by adjusting our tox.ini file. This commit fixes the following new hacking errors: H405 - multi line docstring summary not separated with an empty line E265 - block comment should start with '# ' F402 - import 'endpoint' from line 21 shadowed by loop variable Change-Id: I6bae61591fb988cc17fa79e21cb5f1508d22781c
* Fix docstring list formatJoshua Harlow2014-05-281-4/+5
| | | | Change-Id: Ia79560e965e94e2e4ce18f4667c33ae577b327ed
* Factor out the on_failure to a mixin typeJoshua Harlow2014-05-281-19/+33
| | | | | | | | | | To allow for failures to be handled in different ways extract out the on_failure definition of a retry object to allow it to be its own mixin or base class for resolvers that can only provide a on_failure method. Change-Id: Ief422bb57316b913897ca65496144edcfdd1a948
* Use a name property setter instead of a set_name methodJoshua Harlow2014-05-281-1/+2
| | | | Change-Id: I4a41204e16e636e12d649592ae909d45fdb33f9f
* Rework atom documentationJoshua Harlow2014-05-241-1/+1
| | | | | | | | | | Expand on what atoms, tasks, and retries are used for an what there mission is and explain in more depth (with usage examples) how retry atoms can be used to resolve failures that happen. Change-Id: Icc585c8a9b87e070f12a267e531225f87412cd5f
* Rewrite assertion for same elements in sequencesIvan A. Melnikov2014-03-221-9/+5
| | | | | | | | | | | | New version is able to compare sequences whith elements that are not hashable and cannot be compared (so that sorted() does not work). For that, a utility function that caluclates difference between two sequences was added. This function was also used in retry.ForEachBase. The assertion was also renamed to assertItemsEqual, which matches same assertion that was added in python 2.7. Change-Id: I2b1b811190e9dc51718e4ca17ffc5c9015c34dc4
* Remove extraneous vim configuration commentsIvan A. Melnikov2014-03-191-2/+0
| | | | Change-Id: Ib0f065b02e053ca6dd176eb8d6a75cf71e0982d0
* Fix few minor spelling errorsIvan A. Melnikov2014-03-181-1/+1
| | | | Change-Id: I68082263189435af22d2bd6a63cc1ec77419668d
* Flow smart revert with retry controllerAnastasia Karpinska2014-03-181-0/+84
| | | | | | | | | | | | | | | | | | | - Remove flow REVERTING state. Now flow can be running and reverting simultaneously. Until flow isn't finished it is in RUNNING state. - Add RETRYING state for the retry controller. - Implement smart revertion and flow retries and retries resumption. - Default retry controllers: Times, ForEach and ParameterizedForEach. - Example and unit tests. Implements: blueprint subgraph-execution Implements: blueprint reversion-strategies Implements: blueprint smart-revert Change-Id: Ifa600bcad1edf2910f02ac36783cd458afbd880c
* Add base class for RetryAnastasia Karpinska2014-03-141-0/+101
Change-Id: Ia0e467bd87c7830c90d3054f7b6a54368c3e018b