You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the "list/read News" feature of Arch-Update makes multiple curl requests to https://archlinux.org in order to extract and parse the list of recent news.
Some of those requests can take a long time on poor network connections (or during network instabilities) and they currently have no default timeout set, meaning they can result in an unexpected "freeze" (it's not actually frozen, just taking a very long time) for some people having a poor network connection (or being subject to network instabilities).
Here's a proposal to handle such cases at the Arch-Update level (as best as it can... It cannot fix people's network connection unfortunately 😝):
Print a message saying that Arch-Update is looking for recent Arch News (to avoid people thinking the script is just stuck in those situations)
Optimize the requests made to https://archlinux.org within the "News" function of the script by merging them (the first and second curl requests can be merged into one to avoid making multiple requests unnecessarily).
Add a default timeout to curl requests (--max-time option) to cut out/stop requests if they didn't finished after a reasonable time (30 sec?). In such cases, print a message to users like "Couldn't check for recent news in a reasonable time. Please, check https://archlinux.org/news/ for any recent news".
The text was updated successfully, but these errors were encountered:
Antiz96
changed the title
Optimize the "News" function and a timeout for requests
Optimize the "News" function and add a timeout to curl requests
Jul 8, 2024
This commit brings multiple improvements to the "News" function of the main script in order to optimize it and avoid unexpected behaviors:
- Print a message when Arch-Update is looking for recent Arch News (to avoid people thinking the script is just stuck in case it takes some time due to network instability/slowness)
- Print a message if no recent Arch News has been found since the last run
- Optimize the curl requests by merging the two first ones into a single one
- Add a default 30 sec timeout (`--max-time 30`) to curl requests so they don't end taking multiple minutes on slow/faulty network connection). If the timeout is reached, Arch-Update prints a warning explaining that it wasn't able to retrieve Arch News in a reasonable time, prints the URL of the Arch website or the URL of the selected news (so users can still look that up separately) and move on to the packages updates.
Fixes#206
Environment
Arch-Update configuration
None
Description of the bug
Currently, the "list/read News" feature of Arch-Update makes multiple curl requests to https://archlinux.org in order to extract and parse the list of recent news.
Some of those requests can take a long time on poor network connections (or during network instabilities) and they currently have no default timeout set, meaning they can result in an unexpected "freeze" (it's not actually frozen, just taking a very long time) for some people having a poor network connection (or being subject to network instabilities).
Screenshots / Logs
See this video at 12:54
https://youtu.be/on7iI-0a_Hw?si=2Ug54ZI_-KcUBXB-&t=774
Additional context
Here's a proposal to handle such cases at the Arch-Update level (as best as it can... It cannot fix people's network connection unfortunately 😝):
--max-time
option) to cut out/stop requests if they didn't finished after a reasonable time (30 sec?). In such cases, print a message to users like "Couldn't check for recent news in a reasonable time. Please, check https://archlinux.org/news/ for any recent news".The text was updated successfully, but these errors were encountered: