[opensuse-buildservice] historic errors showing up again in linkedbuild projects
Hi, It's me again. It seems I am running into all bugs related to linkedbuild projects in combination with source services. Probably I am the only user of this feature set combination. ;) Now, here it is: With current versions, including up to this version: commit ad4cc3d11b9b6daed710f7d7bad80d7b9440c2e6 Author: Michael Schroeder <mls@suse.de> Date: Fri Dec 16 16:02:38 2011 +0100 [backend] use url as fallback for title in patchinfo references I can see the following behavior: 1. I have a project (referring to as the main project in the following) including some packages using source services that pull their sources from an external server. 2. I have other projects that have a subset of packages from the previous projects and pull in the rest of the packages with the linkedbuild feature. 3. One day the external source server referred to in the source services was temporarily down, thus leading to source service errors in the main project and thus some broken packages. 4. After the external source server came back up again I retriggered all source service runs that previously failed and got successful results, such that all packages in the project were fine again. 5. Some packages (but interestingly not all of them) in the linkedbuild projects kept the error. It is not possible to retrigger the runs there since those packages are only linked ones and no real ones. 6. Making an explicit copy of an affected package into the linkedbuild project fixes the problem, since the package is now a materialized copy and thus causes a separate source service run. As soon as this copy is removed again though and the project falls back to the linked project the error reappears. 7. Creating a new linkedbuild project has the same broken packages, even though the packages had been fixed in the main project already long time before the new linkedbuild project was created. So, to sum this up: What I observed in 5-7 seems to be a bug that the source service results are not always copied correctly, picking an outdated result for copying instead of the most recent one. Especially the fact that the problem even persists for newly created projects makes me a bit nervous about the reliability here. Anyone with an idea, what could be causing that, which places in the sources I should focus on for searching for the cause? Alternatively does someone have a good idea for a suitable workaround that is smarter than my current approach to just explicitly copy in all packages that suffer from this behavior? Robert -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Hello, On Monday, December 19, 2011 11:21:31 AM Robert Schiele wrote: [...]
So, to sum this up: What I observed in 5-7 seems to be a bug that the source service results are not always copied correctly, picking an outdated result for copying instead of the most recent one. Especially the fact that the problem even persists for newly created projects makes me a bit nervous about the reliability here.
Anyone with an idea, what could be causing that, which places in the sources I should focus on for searching for the cause? Alternatively does someone have a good idea for a suitable workaround that is smarter than my current approach to just explicitly copy in all packages that suffer from this behavior? [...]
reproduced the issue and it seems to be that not all meta data gets copied to the linking project. handleservice and other are looking for xservicemd5 metadata and others. Since it does not found those meta data it triggers a source service run. But the source files actually got correctly copied, so the source service run could and should be avoided. I made a pull request for a patch which copies all known meta data: https://github.com/openSUSE/open-build-service/pull/23 This patch only avoids avoidable serviceruns, e.g. if a linkedproject=all get created. But there is still at least one open issue or thing to discuss we have to look into: - retrigger of servicerun of the origin project causes that all linkedprojects trigger a servicerun: this might could be avoided as well by coping tree meta data and sources to linkedprojects instead of doing multiple sourceservice runs. - other cases which might be checked for similiar linkedproject issues? Best Regards, Daniel --- commit cd82c3d903fb2a4e8eba3e1ff9aced46edf7e53c Author: Daniel Gollub <gollub@b1-systems.de> Date: Fri Jan 20 09:10:13 2012 +0100 [backend] copy all known tree meta data Commit 97c1d6c61 introduce only a partial copy of the required meta data. This commit copies additionally to the srcmd5 metadata, also the meta data of: lsrcmd5, xservicemd5, lservicemd5 - if available. This is required for linkproject=all projects to avoid redudant source service triggers. As the meta data did not get copied, handleservice always triggered a source service run for linkedprojects. Even when the sources already got copied with copyfiles(). diff --git a/src/backend/bs_srcserver b/src/backend/bs_srcserver index d82fff2..902112d 100755 --- a/src/backend/bs_srcserver +++ b/src/backend/bs_srcserver @@ -680,6 +680,20 @@ sub copyfiles { } } +sub copytreefile { + my ($treedir, $lprojid, $packid, $md5) = @_; + return unless $md5; + + my $ltreedir = "$treesdir/$lprojid/$packid"; + $ltreedir = "$srcrep/$packid" if $BSConfig::nosharedtrees == 2 && ! -e "$ltreedir/$md5-MD5SUMS"; + + if (-e "$ltreedir/$md5-MD5SUMS") { + my $meta = readstr("$ltreedir/$md5-MD5SUMS"); + mkdir_p($treedir); + writestr("$uploaddir/$$", "$treedir/$md5-MD5SUMS", $meta); + } +} + sub getrev_git { my ($projid, $packid, $rev) = @_; my $gitdir = "$projectsdir/$projid.pkg/$packid.git"; @@ -723,20 +737,32 @@ sub getrev { if ($lrev) { # make sure that we may access the sources of this package checksourceaccess($lprojid, $packid); - my $files = lsrev($lrev); + + my $linkinfo = {}; + my $files = lsrev($lrev, $linkinfo); + copyfiles($projid, $packid, $lprojid, $packid, $files); + my $srcmd5 = $lrev->{'srcmd5'}; + my $lsrcmd5 = $linkinfo->{'lsrcmd5'}; + my $xservicemd5 = $linkinfo->{'xservicemd5'}; + my $lservicemd5 = $linkinfo->{'lservicemd5'}; + if ($BSConfig::nosharedtrees && $srcmd5 ne $emptysrcmd5) { # copy the tree my $treedir = "$treesdir/$projid/$packid"; if (! -e "$treedir/$srcmd5-MD5SUMS") { my $ltreedir = "$treesdir/$lprojid/$packid"; $ltreedir = "$srcrep/$packid" if $BSConfig::nosharedtrees == 2 && ! -e "$ltreedir/$srcmd5-MD5SUMS"; - if (-e "$ltreedir/$srcmd5-MD5SUMS") { - my $meta = readstr("$ltreedir/$srcmd5-MD5SUMS"); - mkdir_p($treedir); - writestr("$uploaddir/$$", "$treedir/$srcmd5-MD5SUMS", $meta); - } else { + + # try to copy all known tree files, otherwise this might trigger + # avoidable runservice calls. Goal: avoid all avoidable runservices. + copytreefile($treedir, $lprojid, $packid, $lsrcmd5); + copytreefile($treedir, $lprojid, $packid, $lservicemd5); + copytreefile($treedir, $lprojid, $packid, $xservicemd5); + + copytreefile($treedir, $lprojid, $packid, $srcmd5); + if (! -e "$ltreedir/$srcmd5-MD5SUMS") { addmeta($projid, $packid, $files); # last resort... } } -- Daniel Gollub Linux Consultant & Developer Tel.: +49-160 47 73 970 Mail: gollub@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (2)
-
Daniel Gollub
-
Robert Schiele