Open Bug 1919884 Opened 1 year ago Updated 1 year ago

get_pypi_json() hangs sometimes for a long time

Categories

(Conduit :: moz-phab, defect, P3)

Tracking

(Not tracked)

REOPENED

People

(Reporter: saschanaz, Unassigned)

References

Details

moz-phab version (from moz-phab --version): 1.5.1
Python version (from python3 --version): 3.11.9
OS: Windows 11

Not sure why but logging with DEBUG=1 shows it hangs for minutes between "forced version check: false" and pypi version logging.

https://github.com/mozilla-conduit/review/blob/901957058371ed9c502095d19526ac0b94bec722/mozphab/updater.py#L97-L121

Just updated to 1.6.0 on python 3.12, let's see it still happens...

This could be due to slowness on PyPI's API, or an issue with your connection to it. Marking as a low severity since the check should only be triggered once every 3 days.

If this becomes a more common occurrence we could limit the amount of time we allow moz-phab to wait for a response from PyPI. Hopefully this is just a one-off infra issue.

Severity: -- → S4
Priority: -- → P3

Certainly not one-off and has been bugging me recently. Not sure why because accessing https://pypi.org/pypi/MozPhab/json in Firefox on the same machine just loads instantly.

(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #3)

Certainly not one-off and has been bugging me recently. Not sure why because accessing https://pypi.org/pypi/MozPhab/json in Firefox on the same machine just loads instantly.

I just noticed the request is set to have a 30 second timeout, which seems to contradict your experience of the command "hanging for minutes". Very odd...

Could you try running moz-phab with DISABLE_SPINNER=1 in your environment and letting me know if you still see this issue? Although it seems the issue is persisting with DEBUG=1 set, I'd like to rule out that this bug isn't another instance of bug 1882575.

Flags: needinfo?(krosylight)

Tried a few times today after setting self_last_check = 0 but doesn't seem to happen today... either because of the update or somehow magically fixed by itself?

For now I'll close this and reopen if I see it again.

Status: NEW → RESOLVED
Closed: 1 year ago
Flags: needinfo?(krosylight)
Resolution: --- → WORKSFORME

Happened again today and DISABLE_SPINNER=1 doesn't seem to help 🤔

Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---

Reducing timeout value to 1 in get_pypi_json and get_simple_json makes it work (took a few seconds more than just 2 seconds), but that makes no sense?

What's weird is that I don't see any spinner at all without DEBUG=1 either. (DEBUG seems to disable the spinner per the code)

import urllib.request
urllib.request.urlopen(urllib.request.Request("https://pypi.org/pypi/MozPhab/json"), timeout=30)

This alone hangs when it loads instantly on Firefox and Node.js. And timeout=1 makes it work with actual valid response. Again that makes zero sense. Maybe it's https://github.com/python/cpython/issues/95838 (except I don't have any VPN on this machine)?

Filed https://github.com/python/cpython/issues/125049.

You need to log in before you can comment on or make changes to this bug.