FS#23407 - Allow soft failures on Server URLs
Attached to Project:
Pacman
Opened by Dan McGee (toofishes) - Wednesday, 23 March 2011, 18:33 GMT
Last edited by Allan McRae (Allan) - Sunday, 29 June 2014, 07:27 GMT
Opened by Dan McGee (toofishes) - Wednesday, 23 March 2011, 18:33 GMT
Last edited by Allan McRae (Allan) - Sunday, 29 June 2014, 07:27 GMT
|
Details
It would be awesome to have something like this; I've
thought it but haven't done it yet and now I'm seeing a
forum post
(https://bbs.archlinux.org/viewtopic.php?id=115582) as well
about this.
Currently: $ pacSyu :: Synchronizing package databases... testing 45.8K 247.5K/s 00:00:00 [##################################################] 100% error: failed retrieving file 'core.db' from localhost:8954 : HTTP response code said error core is up to date extra is up to date community-testing is up to date multilib is up to date community is up to date Sidenote: It should have errored on extra/multilib/community as well, maybe those just got covered up somehow? and the error stinks, it returned a 404, we can tell the user that. Also, when I wasn't even running my localhost:8954 listening script, I got no errors at all, so not sure what is up with the new curl code. Now that I've been totally sidetracked, Here is the proposal, with plenty of leeway for a different name: [repo] CacheServer = http://localhost:8954/$repo/ Server = http://example.com/$repo/ Where we would treat CacheServer entries as different than Server entries- if they returned a 404 or weren't available, we would simply ignore the failure and move on to the next URL in the list. Additionally, I think it would make sense to skip CacheServer when downloading repository DBs or repository signatures. |
This task depends upon
I thought something similar was already done for the Server entries. I guess it only tries subsequent Server entries if there's a transient (timeout) error? Any reason why Server doesn't behave that way?
I don't really see the benefit of distinguishing these (at least not compared to the added complexity). The only difference I can think of is that there's an implicit, dynamic, limit of retries (i.e. the amount of CacheServer entries). With Server it would try each server in the list, possibly up to some maximum.
Thus I would like to see this implemented asap...
Looking at the code servers are stored in a list... So no way to add an extra attribute/flag whatever to mark the server as cache server.
To those familiar with the code: How to store this information? Or do we add a new list "alpm_list_t *cacheservers" in "struct __alpm_db_t"? How to handle the order then?
https://lists.archlinux.org/pipermail/pacman-dev/2022-January/025492.html
... and sent my current implementation here...
https://lists.archlinux.org/pipermail/pacman-dev/2022-January/025505.html
Anybody wants to give it a try? Add this in your pacman.conf:
[cache-servers]
Server = http://pkgbuild.com/~eworm/$repo/
Visiting with a freshly upgraded laptop and pacredir enabled used to speed this process up tremendously, as there are multiple computers running Arch on the LAN.
At some point, I think I'll also experiment with torrent or ipfs-based caching, which this would make easier.
I would therefore like to see the patch merged, I can help to test if necessary.