Skip to content

Use stamina to retry on HTTP 5xx errors#34

Merged
hugovk merged 1 commit intomainfrom
stamina
Mar 2, 2026
Merged

Use stamina to retry on HTTP 5xx errors#34
hugovk merged 1 commit intomainfrom
stamina

Conversation

@hugovk
Copy link
Copy Markdown
Owner

@hugovk hugovk commented Mar 2, 2026

The last two nightly http://github.com/hugovk/dashboard runs failed due to 502 and 504 errors from GitHub:

Traceback (most recent call last):
  File "/home/runner/work/dashboard/dashboard/github-tools/potential_closeable_issues.py", line 237, in <module>
    main()
    ~~~~^^
  File "/home/runner/work/dashboard/dashboard/github-tools/potential_closeable_issues.py", line 213, in main
    candidates = check_issues(args.start, args.number, args.author, args.sort)
  File "/home/runner/work/dashboard/dashboard/github-tools/potential_closeable_issues.py", line 165, in check_issues
    candidates.extend(check_issue(api, issue))
                      ~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/runner/work/dashboard/dashboard/github-tools/potential_closeable_issues.py", line 71, in check_issue
    pr = api.pulls.get(pr_number)
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/ghapi/core.py", line 63, in __call__
    return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/ghapi/core.py", line 124, in __call__
    res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, decode=False, debug=debug, return_headers=True,
                         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                 route=route or None, query=query or None, data=data or None, return_json=False, timeout=timeout)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/fastcore/net.py", line 230, in urlsend
    return urlread(req, decode=decode, return_json=return_json, return_headers=return_headers, timeout=timeout)
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/fastcore/net.py", line 129, in urlread
    with urlopen(url, data=data, headers=headers, timeout=timeout, **kwargs) as u: res,hdrs = u.read(),u.headers
         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/fastcore/net.py", line 120, in urlopen
    try: return urlopener().open(urlwrap(url, data=data, headers=headers), timeout=timeout)
                ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 493, in open
    response = meth(req, response)
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 602, in http_response
    response = self.parent.error(
        'http', request, response, code, msg, hdrs)
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 531, in error
    return self._call_chain(*args)
           ~~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 611, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway
====Error Body====
{
  "message": "Server Error"
}

https://github.com/hugovk/dashboard/actions/runs/22535823907/job/65282954371

Traceback (most recent call last):
  File "/home/runner/work/dashboard/dashboard/github-tools/potential_closeable_issues.py", line 237, in <module>
    main()
    ~~~~^^
  File "/home/runner/work/dashboard/dashboard/github-tools/potential_closeable_issues.py", line 213, in main
    candidates = check_issues(args.start, args.number, args.author, args.sort)
  File "/home/runner/work/dashboard/dashboard/github-tools/potential_closeable_issues.py", line 165, in check_issues
    candidates.extend(check_issue(api, issue))
                      ~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/runner/work/dashboard/dashboard/github-tools/potential_closeable_issues.py", line 71, in check_issue
    pr = api.pulls.get(pr_number)
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/ghapi/core.py", line 63, in __call__
    return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/ghapi/core.py", line 124, in __call__
    res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, decode=False, debug=debug, return_headers=True,
                         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                 route=route or None, query=query or None, data=data or None, return_json=False, timeout=timeout)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/fastcore/net.py", line 230, in urlsend
    return urlread(req, decode=decode, return_json=return_json, return_headers=return_headers, timeout=timeout)
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/fastcore/net.py", line 129, in urlread
    with urlopen(url, data=data, headers=headers, timeout=timeout, **kwargs) as u: res,hdrs = u.read(),u.headers
         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_temp/setup-uv-cache/environments-v2/potential-closeable-issues-326637f8f40ca124/lib/python3.14/site-packages/fastcore/net.py", line 120, in urlopen
    try: return urlopener().open(urlwrap(url, data=data, headers=headers), timeout=timeout)
                ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 493, in open
    response = meth(req, response)
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 602, in http_response
    response = self.parent.error(
        'http', request, response, code, msg, hdrs)
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 531, in error
    return self._call_chain(*args)
           ~~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/urllib/request.py", line 611, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 504: Gateway Timeout
====Error Body====

https://github.com/hugovk/dashboard/actions/runs/22561110710/job/65347677700

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.19%. Comparing base (d23ed91) to head (9861446).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
potential_closeable_issues.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
- Coverage   12.26%   12.19%   -0.07%     
==========================================
  Files          17       17              
  Lines         734      738       +4     
==========================================
  Hits           90       90              
- Misses        644      648       +4     
Flag Coverage Δ
ubuntu-latest 12.19% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hugovk hugovk merged commit f1d06a7 into main Mar 2, 2026
14 of 20 checks passed
@hugovk hugovk deleted the stamina branch March 2, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant