Skip to content

Commit 26979a1

Browse files
committed
Add @Retry to two more places
Push Health, cause we just observed a failure there; and job details cause that seems like it could fail. I always have a vague recollection that the order of decorators matters so I'm going to fix on instance and then put in a script to double check things. Although truthfully I'm not 100% sure it's necessary.
1 parent 91a5898 commit 26979a1

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

apis/taskcluster.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ def _get_job_details_url(self, push_id):
323323
return self.url_treeherder + "api/jobs/?push_id=%s" % push_id
324324

325325
@logEntryExit
326+
@retry
326327
def get_job_details(self, revision):
327328
push_list_url = self._get_push_list_url(revision)
328329
self.logger.log("Requesting revision %s from %s" % (revision, push_list_url), level=LogLevel.Info)
@@ -379,6 +380,7 @@ def _get_push_health_url(self, revision):
379380
return self.url_treeherder + "api/%spush/health/?revision=%s" % (self.url_project_path, revision)
380381

381382
@logEntryExit
383+
@retry
382384
def get_push_health(self, revision):
383385
push_health_url = self._get_push_health_url(revision)
384386
self.logger.log("Requesting push health for revision %s from %s" % (revision, push_health_url), level=LogLevel.Info)

components/mach_vendor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class VendorProvider(BaseProvider, INeedsCommandProvider, INeedsLoggingProvider)
2020
def __init__(self, config):
2121
pass
2222

23-
@retry
2423
@logEntryExit
24+
@retry
2525
def check_for_update(self, library):
2626
result = self.run(["./mach", "vendor", "--check-for-update", library.yaml_path]).stdout.decode().strip()
2727

format.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,20 @@
22

33
poetry run autopep8 .
44
poetry run flake8 .
5+
6+
output=$(find . -type f -name '*.py' -exec awk '
7+
/^[ \t]*@retry[ \t]*$/ {
8+
getline a
9+
if (a ~ /^[ \t]*@logEntryExit[ \t]*$/) {
10+
getline b
11+
print FILENAME ":"
12+
print $0 "\n" a "\n" b "\n"
13+
}
14+
}
15+
' {} +)
16+
17+
# Check if there was any output
18+
if [[ -n "$output" ]]; then
19+
echo "@retry must always be the decorator right before a function. Please fix these:"
20+
echo "$output"
21+
fi

0 commit comments

Comments
 (0)