Bug 252413 - ports-mgmt/pkg: set timeout don't work
Summary: ports-mgmt/pkg: set timeout don't work
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-04 16:57 UTC by albert.shih
Modified: 2021-01-09 04:03 UTC (History)
2 users (show)

See Also:
linimon: maintainer-feedback? (pkg)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description albert.shih 2021-01-04 16:57:37 UTC
Hi, 

When a server of pkg repos are down the set of FETCH_TIMEOUT and FETCH_RETRY does not work correctly.

If the server are still reachable on the IP level, the FETCH_TIMEOUT & FETCH_RETRY work fine. 

If the server are off the FETCH_TIMEOUT not working. 

Way to test : 

Set a FETCH_TIMEOUT are very low like 2 ou 4.
Set any IP address not up in the /usr/local/etc/pkg/repos/YOUR_REPOS.conf
Try to do the pkg -d update.

I also try to passe HTTP_TIMEOUT through PKG_ENV but don't change anything

Example:

Options in pkg.conf

debug_level: 4,
fetch_retry: 1,
fetch_timeout: 1,

When the nginx are down but the server himself are up

[root /usr/local/etc]# date; pkg update ; date
Mon Jan  4 17:40:26 CET 2021
DBG(1)[14018]> PkgConfig: loading repositories in /etc/pkg/
DBG(1)[14018]> PkgConfig: loading repositories in /usr/local/etc/pkg/repos/
DBG(1)[14018]> PKgConfig: loading /usr/local/etc/pkg/repos//122R-default.conf
DBG(1)[14018]> PkgConfig: parsing key '122R-default'
DBG(1)[14018]> PkgConfig: parsing repository object 122R-default
DBG(1)[14018]> PKgConfig: loading /usr/local/etc/pkg/repos//FreeBSD.conf
DBG(1)[14018]> PkgConfig: parsing key 'FreeBSD'
DBG(1)[14018]> PkgConfig: parsing repository object FreeBSD
Updating 122R-default repository catalogue...
DBG(1)[14018]> PkgRepo: verifying update for 122R-default
DBG(1)[14018]> PkgRepo: need forced update of 122R-default
DBG(1)[14018]> Pkgrepo, begin update of '/var/db/pkg/repo-122R-default.sqlite'
DBG(1)[14018]> Request to fetch pkg+http://x.y.z.t/packages/122R-default/meta.conf
DBG(1)[14018]> opening libfetch fetcher
DBG(1)[14018]> Fetch > libfetch: connecting
DBG(1)[14018]> Fetch: fetching from: http://x.y.z.t/packages/122R-default/meta.conf with opts "iv"
resolving server address: x.y.z.t:80
failed to connect to x.y.z.t:80
DBG(1)[14018]> Request to fetch pkg+http://x.y.z.t/packages/122R-default/meta.txz
DBG(1)[14018]> opening libfetch fetcher
DBG(1)[14018]> Fetch > libfetch: connecting
DBG(1)[14018]> Fetch: fetching from: http://x.y.z.t/packages/122R-default/meta.txz with opts "iv"
resolving server address: x.y.z.t:80
failed to connect to x.y.z.t:80
pkg: http://x.y.z.t/packages/122R-default/meta.txz: Connection refused
repository 122R-default has no meta file, using default settings
DBG(1)[14018]> Request to fetch pkg+http://x.y.z.t/packages/122R-default/packagesite.txz
DBG(1)[14018]> opening libfetch fetcher
DBG(1)[14018]> Fetch > libfetch: connecting
DBG(1)[14018]> Fetch: fetching from: http://x.y.z.t/packages/122R-default/packagesite.txz with opts "iv"
resolving server address: x.y.z.t:80
failed to connect to x.y.z.t:80
pkg: http://x.y.z.t/packages/122R-default/packagesite.txz: Connection refused
Unable to update repository 122R-default
Error updating repositories!                                                                                                                                   
Mon Jan  4 17:40:26 CET 2021                                                                                                                                   
[root /usr/local/etc]# 

When the server are down

[root /usr/local/etc]# date; pkg update ; date                                                                                                                 
Mon Jan  4 17:46:20 CET 2021
DBG(1)[23143]> PkgConfig: loading repositories in /etc/pkg/
DBG(1)[23143]> PkgConfig: loading repositories in /usr/local/etc/pkg/repos/
DBG(1)[23143]> PKgConfig: loading /usr/local/etc/pkg/repos//122R-default.conf
DBG(1)[23143]> PkgConfig: parsing key '122R-default'
DBG(1)[23143]> PkgConfig: parsing repository object 122R-default
DBG(1)[23143]> PKgConfig: loading /usr/local/etc/pkg/repos//FreeBSD.conf
DBG(1)[23143]> PkgConfig: parsing key 'FreeBSD'
DBG(1)[23143]> PkgConfig: parsing repository object FreeBSD
Updating 122R-default repository catalogue...
DBG(1)[23143]> PkgRepo: verifying update for 122R-default
DBG(1)[23143]> PkgRepo: need forced update of 122R-default
DBG(1)[23143]> Pkgrepo, begin update of '/var/db/pkg/repo-122R-default.sqlite'
DBG(1)[23143]> Request to fetch pkg+http://x.y.z.t/packages/122R-default/meta.conf
DBG(1)[23143]> opening libfetch fetcher
DBG(1)[23143]> Fetch > libfetch: connecting
DBG(1)[23143]> Fetch: fetching from: http://x.y.z.t/packages/122R-default/meta.conf with opts "iv"
resolving server address: x.y.z.t:80
failed to connect to x.y.z.t:80
DBG(1)[23143]> Request to fetch pkg+http://x.y.z.t/packages/122R-default/meta.txz
DBG(1)[23143]> opening libfetch fetcher
DBG(1)[23143]> Fetch > libfetch: connecting
DBG(1)[23143]> Fetch: fetching from: http://x.y.z.t/packages/122R-default/meta.txz with opts "iv"
resolving server address: x.y.z.t:80
failed to connect to x.y.z.t:80
pkg: http://x.y.z.t/packages/122R-default/meta.txz: Operation timed out
repository 122R-default has no meta file, using default settings
DBG(1)[23143]> Request to fetch pkg+http://x.y.z.t/packages/122R-default/packagesite.txz
DBG(1)[23143]> opening libfetch fetcher
DBG(1)[23143]> Fetch > libfetch: connecting
DBG(1)[23143]> Fetch: fetching from: http://x.y.z.t/packages/122R-default/packagesite.txz with opts "iv"
resolving server address: x.y.z.t:80
failed to connect to x.y.z.t:80
pkg: http://x.y.z.t/packages/122R-default/packagesite.txz: Operation timed out
Unable to update repository 122R-default
Error updating repositories!
Mon Jan  4 17:50:06 CET 2021
[root /usr/local/etc]#