ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan \"Rambius\" Ivanov" <rambiusparkisan...@yahoo.com>
Subject Re: Problem when running ivy in threads
Date Tue, 06 Nov 2007 19:51:25 GMT
Hello Giles,

Thank you for your response.

--- Gilles Scokart <gscokart@gmail.com> wrote:
> You might be right, but in your example, you only
> have a single thread.  So
> it is rather a problem of file handle not closed.
Yes, you are right. After I switched to 1 thread in
CruiseControl there are still locked files.
 
> Did you tried with a 2.0 version.  I think that some
> missing close have been
> added a few months ago.
Yes, I did. I tested the use case with the following
code:

import java.io.File;
import java.net.URL;

import org.apache.ivy.Ivy;
import
org.apache.ivy.core.module.descriptor.ModuleDescriptor;
import
org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;

public class Main {

    public static void main(String[] args) throws
Exception {
        String ivyDescriptor = args[0];// location of
any ivy.xml
        Ivy ivy = new Ivy();
        ivy.configureDefault();

        ModuleDescriptorParserRegistry mdpr =
ModuleDescriptorParserRegistry.getInstance();
        File ivyFile = new File(ivyDescriptor);
        URL ivyFileURL = ivyFile.toURL();
        ModuleDescriptor md =
mdpr.parseDescriptor(ivy.getSettings(), ivyFileURL,
true);
        System.out.println("module name is " +
md.getModuleRevisionId().getName());
		
        Thread.sleep(60 * 1000);
    }
}

When I executed this code with the latest ivy from svn
the file was not locked.

> By the way, what are the difference between your
> plugin and ivyCruise?  
> Did you restart from scratch or did you updated it? 

I used ivycruise only as an example for my plugins. I
started from scratch. IvyCruise makes lots of
assumptions which are not true for my project:
-) It assumes the names of the ivy modules are the
same as the names of the cruisecontrol projects - I am
building different branches of one project and I
append the branch name to the project name in
CruiseControl
-) IvyCruise assumes that all ivy projects are built
in the same CruiseControl instance - I have 2
CruiseControl instances publishing to one central ivy
repository. I have cases like 2 depenendencies of a
project are built by one of the CruiseControl servers,
and 3 dependencies by the other. In this case I can
query only the Ivy repository to find out of there is
a new revision of a given dependency.

> Maybe you have some usefull info.
I have also some working code. I will discuss it with
my boss if I can contribute it back. For now, here is
my algorithm. I am using a sourcecontrol plugin [1]
and a publisher plugin

-) After a successful publication to the ivy
repository of an ivy module built by CruiseControl,
the CC publisher copies the delivered ivy.xml to
$CRUISECONTROL_HOME/logs/${project.name}/ivy.xml

-) When a new build is started the ivy.xml of the
previous build is taken (from
$CRUISECONTROL_HOME/logs/${project.name}/ivy.xml) and
parsed. Then the current ivy.xml is again parsed and
all the dependencies whose names start with "latest"
are taken and compared with the same dependencies from
the old ivy.xml. If a difference is found, it is
considered a modification.

> PS: note that <thread> of cruise control only
> control the number of build in
> parallel, but every project has his own thread used
> when invoking your
> modification set plugin.  So, even if you set thread
> to 1, you will still
> have your modificationset executed in multithread.
Yes, I checked CruiseControl code and found this out.

Regards
Rambius

Tangra Mega Rock: http://www.radiotangra.com/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message