Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 773517 - app-text/build-docbook-catalog updates are not atomic & break packages building in parallel
Summary: app-text/build-docbook-catalog updates are not atomic & break packages buildi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-01 08:32 UTC by SpanKY
Modified: 2021-10-03 04:06 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2021-03-01 08:32:29 UTC
simple reproduction:
  emerge -1bqO app-text/docbook-xml-dtd:4.{2..5}
  while emerge -1qOK -j4 app-text/docbook-xml-dtd:4.{2..5}; do :; done &
  while emerge dev-util/glib-utils -1qO; do :; done

wait long enough and you'll see the xsltproc call in glib-utils fail.  this is because docbook-xml-dtd invokes `build-docbook-catalog` and that tool doesn't update the /etc/xml/ content atomically.  it grabs a lock on the dir, but it's only to protect against parallel runs of build-docbook-catalog itself.
Comment 1 Larry the Git Cow gentoo-dev 2021-10-03 04:01:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/build-docbook-catalog.git/commit/?id=203b974cdde83e876ba665df47928868278581ae

commit 203b974cdde83e876ba665df47928868278581ae
Author:     Mike Frysinger <vapier@gentoo.org>
AuthorDate: 2021-10-03 03:25:41 +0000
Commit:     Mike Frysinger <vapier@gentoo.org>
CommitDate: 2021-10-03 03:25:41 +0000

    make file updates atomic
    
    While we have locks against other invocations of build-docbook-catalog
    to keep them from clobbering each other (write locks), we didn't have
    any locks for users of the databases (read locks).  Rewriting the files
    in place causes those readers to get partially written files and then
    fail (due to missing entries).
    
    Closes: https://bugs.gentoo.org/773517
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

 build-docbook-catalog | 51 +++++++++++++++++++++++++++++++--------------------
 1 file changed, 31 insertions(+), 20 deletions(-)
Comment 2 Larry the Git Cow gentoo-dev 2021-10-03 04:06:31 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3a44d39bd48d2e1ed7c1a8f8805175cbb1c2a29

commit d3a44d39bd48d2e1ed7c1a8f8805175cbb1c2a29
Author:     Mike Frysinger <vapier@gentoo.org>
AuthorDate: 2021-10-03 04:05:38 +0000
Commit:     Mike Frysinger <vapier@gentoo.org>
CommitDate: 2021-10-03 04:06:08 +0000

    app-text/build-docbook-catalog: version bump to 2.0
    
    Closes: https://bugs.gentoo.org/773517
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

 app-text/build-docbook-catalog/Manifest            |  1 +
 .../build-docbook-catalog-2.0.ebuild               | 36 ++++++++++++++++++++++
 2 files changed, 37 insertions(+)