get_pypi_json() hangs sometimes for a long time
Categories
(Conduit :: moz-phab, defect, P3)
Tracking
(Not tracked)
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.
| Reporter | ||
Comment 1•1 year ago
|
||
Just updated to 1.6.0 on python 3.12, let's see it still happens...
Comment 2•1 year ago
|
||
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.
| Reporter | ||
Comment 3•1 year ago
|
||
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.
Comment 4•1 year ago
|
||
(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...
Comment 5•1 year ago
|
||
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.
| Reporter | ||
Comment 6•1 year ago
|
||
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.
| Reporter | ||
Comment 7•1 year ago
|
||
Happened again today and DISABLE_SPINNER=1 doesn't seem to help 🤔
| Reporter | ||
Comment 8•1 year ago
|
||
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?
| Reporter | ||
Comment 9•1 year ago
|
||
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)
| Reporter | ||
Comment 10•1 year ago
•
|
||
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)?
Updated•1 year ago
|
Description
•