Closed
Bug 732641
Opened 13 years ago
Closed 13 years ago
Implement @retriable decorator to simplify usage of retry()
Categories
(Release Engineering :: General, enhancement, P3)
Release Engineering
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: rail, Assigned: rail)
Details
Attachments
(1 file, 2 obsolete files)
6.41 KB,
patch
|
bhearsum
:
review+
rail
:
checked-in+
|
Details | Diff | Splinter Review |
Sometimes it's hard to read the code wrapped with retry() function, especially if you want to pass just one parameter:
retry(func, args=(foo,), retry_exceptions=(MyError,), ...)
Sometimes it's simpler to make a function retriable always and call it directly:
@retriable(retry_exceptions=(MyError,))
def func(foo):
...
func(foo)
Initial implementation with tests attached.
Assignee | ||
Updated•13 years ago
|
Attachment #602546 -
Flags: review?(bhearsum)
Updated•13 years ago
|
Attachment #602546 -
Flags: review?(bhearsum) → review+
Assignee | ||
Comment 1•13 years ago
|
||
It turned out that I prepared the patch against an old tools repo. :/
Refreshed patch sleeptime explicitly set to 0. No changes in retry.py.
Attachment #602546 -
Attachment is obsolete: true
Attachment #603342 -
Flags: review?(bhearsum)
Updated•13 years ago
|
Attachment #603342 -
Flags: review?(bhearsum) → review+
Assignee | ||
Comment 2•13 years ago
|
||
Comment on attachment 603342 [details] [diff] [review]
retriable
http://hg.mozilla.org/build/tools/rev/14542113c240
Attachment #603342 -
Flags: checked-in+
Assignee | ||
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 3•13 years ago
|
||
Comment on attachment 603342 [details] [diff] [review]
retriable
Python 2.5 bustage fix
http://hg.mozilla.org/build/tools/rev/78c8caa0cd5b
Assignee | ||
Comment 4•13 years ago
|
||
Python 2.5 failed:
Traceback (most recent call last):
File "e:/builds/moz2_slave/m-in-w32/tools/buildfarm/utils/retry.py", line 16, in <module>
from util.retry import retry
File "e:/builds/moz2_slave/m-in-w32/tools/buildfarm/utils\../../lib/python\util\retry.py", line 57
return retry(func, *retry_args, args=args, kwargs=kwargs,
^
SyntaxError: invalid syntax
Ben backed out the patches.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•13 years ago
|
Attachment #603342 -
Flags: checked-in+ → checked-in-
Assignee | ||
Comment 5•13 years ago
|
||
I changed the order of arguments being passed to retry() to be compatible with python 2.5 (1 liner change).
Unit tests have passed python 2.6.5 (linux build slave), 2.7.2 (my laptop) and 2.5 (Windows build slave).
Attachment #603342 -
Attachment is obsolete: true
Attachment #607144 -
Flags: review?(bhearsum)
Updated•13 years ago
|
Attachment #607144 -
Flags: review?(bhearsum) → review+
Assignee | ||
Comment 6•13 years ago
|
||
Comment on attachment 607144 [details] [diff] [review]
retriable
http://hg.mozilla.org/build/tools/rev/deb5c98730d7
Attachment #607144 -
Flags: checked-in+
Assignee | ||
Comment 7•13 years ago
|
||
Looks like it worked properly this time.
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Product: mozilla.org → Release Engineering
You need to log in
before you can comment on or make changes to this bug.
Description
•