Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 245231 - sys-apps/portage-2.2_rc13 waits for lockfile with -fOp
Summary: sys-apps/portage-2.2_rc13 waits for lockfile with -fOp
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - External Interaction (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 210077
  Show dependency tree
 
Reported: 2008-11-02 06:33 UTC by Martin Väth
Modified: 2008-11-11 22:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
use a private temp directory instead of the main one (fetch_tmp.patch,1.25 KB, patch)
2008-11-02 09:07 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Väth 2008-11-02 06:33:44 UTC
With sys-apps/portage-2.2_rc13, getdelta.sh waits forever, because it calls
  GENTOO_MIRRORS="" emerge -fOp =category/package-version
to get the non-mirrored address which then (because it is called from emerge
via FETCHOMMAND) sees a lockfile and waits for the mother process to
finish...

This did not happen with =sys-apps/portage-2.2_rc12 or earlier versions,
and indeed it seems that there should not be a reason to wait for a lockfile.
If this is technically too hard, perhaps another command could be provided
which app-portage/getdelta could use, or - even better - the non-mirrored
address could be passed in an environment variable to FETCHOMMAND
(which would speed up gedelta quite a bit and perhaps also has other uses).
Comment 1 Zac Medico gentoo-dev 2008-11-02 07:14:30 UTC
(In reply to comment #0)
> This did not happen with =sys-apps/portage-2.2_rc12 or earlier versions,
> and indeed it seems that there should not be a reason to wait for a lockfile.

It's only needed for cases when the pkg_nofetch() phase has to be executed (bug #241118). In this case, the locked directory is used to collect elog messages and to provide a safe working directory for bug #239560.

In order to avoid the need to lock the directory, we can use mkdtemp() to allocate a temporary directory. 

> If this is technically too hard, perhaps another command could be provided
> which app-portage/getdelta could use, or - even better - the non-mirrored
> address could be passed in an environment variable to FETCHOMMAND
> (which would speed up gedelta quite a bit and perhaps also has other uses).

I'm not sure exactly what's required here. In some cases there are multiple non-mirrored URIs available, and in other cases only mirrored URIs are available.
Comment 2 Martin Väth 2008-11-02 08:16:42 UTC
(In reply to comment #1)
> I'm not sure exactly what's required here. In some cases there are multiple
> non-mirrored URIs available, and in other cases only mirrored URIs are
> available.

I am not an author of getdelta and can only guess what happens on the server
side. However, the script simply considers the words (space or newline
separated) output by
  GENTOO_MIRRORS="" emerge -fOp =category/package-version
and uses the last of those word which is an address and contains the
filename to be fetched.

So I guess just putting the output which you would get with GENTOO_MIRRORS=""
into some variable (optionally eliminating those entries which do not end
with the name for the current file to be fetched) would be sufficient for
getdelta.
Comment 3 Zac Medico gentoo-dev 2008-11-02 09:07:51 UTC
Created attachment 170521 [details, diff]
use a private temp directory instead of the main one

If this patch is saved as /tmp/fetch_tmp.patch, then it can be applied as follows:

  patch /usr/lib/portage/pym/_emerge/__init__.py /tmp/fetch_tmp.patch
Comment 4 Martin Väth 2008-11-02 18:49:05 UTC
Thanks. The patch works smoothly.
Comment 5 Zac Medico gentoo-dev 2008-11-11 22:21:06 UTC
This is fixed in 2.2_rc14.