Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318701 - unable to move artifacts when repo already exists on fileshare
Summary: unable to move artifacts when repo already exists on fileshare
Status: RESOLVED FIXED
Alias: None
Product: CBI
Classification: Technology
Component: CBI p2 Repository Aggregator (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Filip Hrbek CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 07:56 EDT by David Samuelsson CLA
Modified: 2016-09-16 15:58 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Samuelsson CLA 2010-07-02 07:56:16 EDT
using Eclipse Helios release.
b3 Aggregator Editor (Incubation)	0.1.0.r01087

When trying to aggregate the helios release, that has already been aggregated before (i.e. artifacts is already stored on a share) it fails when trying to move the old artifacts i.e:

Unable to move Y:\VE_Update_Site_libraries\lib\Hudson_aggregated\Helios\se.rsv.zz.org.eclipse.helios.mirror.b3aggr\final\artifacts.jar to Y:\VE_Update_Site_libraries\lib\Hudson_aggregated\Helios\se.rsv.zz.org.eclipse.helios.mirror.b3aggr\final\aggregate\artifacts.jar

it actually suceeds as the artifact is moved but returns this error above anyways. Trying to run the "build" again and it will fail with the next artifact:

Unable to move Y:\VE_Update_Site_libraries\lib\Hudson_aggregated\Helios\se.rsv.zz.org.eclipse.helios.mirror.b3aggr\final\plugins to Y:\VE_Update_Site_libraries\lib\Hudson_aggregated\Helios\se.rsv.zz.org.eclipse.helios.mirror.b3aggr\final\aggregate\plugins

etc..it goes on like this until it has moved all to the aggregate folder then it will succeed in the aggregation.

This problem does not occour if i clean then build first of course. Only seen this in UI, haven't tested in headless yet.
Comment 1 David Samuelsson CLA 2010-07-22 06:44:52 EDT
same problem manifested in headless.
Comment 2 Phil Denis CLA 2010-07-27 17:27:40 EDT
Looking at the source code of org.eclipse.b3.aggregator.engine.MirrorGenerator the problem is obvious.

On line 466 the first file is moved to the aggregate directory.  On line 467, an exception is thrown.

oldLocation.renameTo(newLocation);
throw ExceptionUtils.fromMessage("Unable to move %s to %s", oldLocation.getAbsolutePath(), newLocation.getAbsolutePath());

But it is not checking the return value of renameTo.  Instead, it should be like this:
if (!oldLocation.renameTo(newLocation)) {
    throw ExceptionUtils.fromMessage("Unable to move %s to %s", oldLocation.getAbsolutePath(), newLocation.getAbsolutePath());
}

There are 2 other places in this class that use the correct pattern.  Its just this one that is missing the test for the return condition.
Comment 3 Thomas Hallgren CLA 2011-07-09 04:19:05 EDT
Fixed sometime prior to revision 1499.
Comment 4 David Williams CLA 2016-09-16 15:58:08 EDT
[Bookkeeping change only. Moving bugs to the new "home" of aggregator, CBI.
No change to assignee for resolved and verified bugs.]