On Wed, Jun 17, 2020 at 11:34:20AM +0200, Solene Rapenne wrote: > I propose a small diff for pkg_add when using http/https mirrors. > Don't wait 30 seconds for the ftp process to stop when closing > file handler, send SIGHUP immediately after closing the file handler. > > Running pkg_add -u neovim (already installed and up to date) I got > those results of bandwidth usage > > using mirror https://mirror.one.com/pub/OpenBSD/ > 62513 kB without diff > 9050 kB with diff > > using mirror https://ftp.fr.openbsd.org/pub/OpenBSD > 6530 kB without diff > 6373 kB with diff > > The 2500 kB difference between the two mirrors with the diff is > explained by the html directory listing which is different > between servers. mirror.one.com list is 3800 kB while > ftp.fr.openbsd.org only 1387 kB. > > I can't explain why but when using mirror.one.com the ftp command will > continuously fetch packages until completion or stop if ftp is killed > after 30 seconds. This extra downloaded data is useless. > > I came with the following diff, but maybe the real issue is ftp(1) > not stopping immediately if output is closed?
Like I said privately to solene, I would very much prefer that we figure out why things don't die "instantly". What pkg_add does internally is a pipeline: ftp | signify|internal gunzip closing the end file handle should kill the whole chain. So I need to figure out where it goes wrong, what's the part that doesn't die "instantly". The thing to do would be to send explicit SIGPIPE to either signify or ftp and see whether things work better.