You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by "Buck, Robert" <rb...@verisign.com> on 2008/03/19 18:15:08 UTC

Cache Assoc with HTTP Resolver Not Used

Hello,
 
I cleaned the resolver cache and repository cache in the local build
area by deleting all files there. I have a third cache associated to the
http resolver, which I left intact. This http cache should generally not
be cleaned by developers so that their multiple sandboxes can resolve
from this local cache rather than go back out across the network.
 
I thought that by adding a cache to the uri resolver that it would use
the cached value rather than refetching it. But as you see below an
attempt was made to redownload the files.

[ivy:resolve] :: resolving dependencies ::
verisign#smq-perf;working@WAT1RBUCK-L
3
[ivy:resolve]   confs: [default]
[ivy:resolve] Mar 19, 2008 1:08:10 PM
org.apache.commons.httpclient.HttpMethodDi
rector executeWithRetry
[ivy:resolve] INFO: I/O exception (java.net.ConnectException) caught
when proces
sing request: Connection refused: connect
[ivy:resolve] Mar 19, 2008 1:08:10 PM
org.apache.commons.httpclient.HttpMethodDi
rector executeWithRetry
[ivy:resolve] INFO: Retrying request
[ivy:resolve] Mar 19, 2008 1:08:11 PM
org.apache.commons.httpclient.HttpMethodDi
rector executeWithRetry
[ivy:resolve] INFO: I/O exception (java.net.ConnectException) caught
when proces
sing request: Connection refused: connect
[ivy:resolve] Mar 19, 2008 1:08:11 PM
org.apache.commons.httpclient.HttpMethodDi
rector executeWithRetry
[ivy:resolve] INFO: Retrying request
[ivy:resolve] Mar 19, 2008 1:08:12 PM
org.apache.commons.httpclient.HttpMethodDi
rector executeWithRetry
[ivy:resolve] INFO: I/O exception (java.net.ConnectException) caught
when proces
sing request: Connection refused: connect
[ivy:resolve] Mar 19, 2008 1:08:12 PM
org.apache.commons.httpclient.HttpMethodDi
rector executeWithRetry
[ivy:resolve] INFO: Retrying request
[ivy:resolve] Mar 19, 2008 1:08:14 PM
org.apache.commons.httpclient.HttpMethodDi
rector executeWithRetry
[ivy:resolve] INFO: I/O exception (java.net.ConnectException) caught
when proces
 
Am I missing something in my configuration that would enable the
behavior that I am seeking?
 
The configuration is provided below.
 
Thanks in advance,
 
Bob
 
 
<?xml version="1.0"?>
<ivysettings>
  <settings defaultResolver="default-chain"/>
  <property name="ivy.volatile.repository"
value="${workspace.root}/ivy/repos/volatile" override="false"/>
  <property name="ivy.isolated.repository"
value="${sandbox.root}/ivy/repos/isolated" override="false"/>
  <caches useOrigin="true"
resolutionCacheDir="${workspace.root}/ivy/cache/resolution"
repositoryCacheDir="${workspace.root}/ivy/cache/repository">
    <cache name="download-cache" lockStrategy="artifact-lock"
basedir="${sandbox.root}/ivy/cache/download"/>
  </caches>
  <resolvers>
    <filesystem name="volatile-resolver">
      <ivy
pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision]/i
vys/ivy-[revision].xml"/>
      <artifact
pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision]/[
type]s/[artifact].[ext]"/>
      <artifact
pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision]/[
type]s/[artifact]-[revision].[ext]"/>
    </filesystem>
    <filesystem name="isolated-resolver">
      <ivy
pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision]/i
vys/ivy-[revision].xml"/>
      <artifact
pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision]/[
type]s/[artifact].[ext]"/>
      <artifact
pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision]/[
type]s/[artifact]-[revision].[ext]"/>
    </filesystem>
    <url name="download-resolver" cache="download-cache">
      <ivy
pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revision
]/ivys/ivy-[revision].xml"/>
      <artifact
pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revision
]/[type]s/[artifact].[ext]"/>
      <artifact
pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revision
]/[type]s/[artifact]-[revision].[ext]"/>
    </url>
    <chain name="default-chain" returnFirst="true">
      <resolver ref="volatile-resolver"/>
      <resolver ref="isolated-resolver"/>
      <resolver ref="download-resolver"/>
    </chain>
  </resolvers>
</ivysettings> 
 

Re: Cache Assoc with HTTP Resolver Not Used

Posted by Xavier Hanin <xa...@gmail.com>.
On Wed, Mar 19, 2008 at 6:15 PM, Buck, Robert <rb...@verisign.com> wrote:

> Hello,
>
> I cleaned the resolver cache and repository cache in the local build
> area by deleting all files there. I have a third cache associated to the
> http resolver, which I left intact. This http cache should generally not
> be cleaned by developers so that their multiple sandboxes can resolve
> from this local cache rather than go back out across the network.
>
> I thought that by adding a cache to the uri resolver that it would use
> the cached value rather than refetching it.

Exactly, that's what it should do.

Your settings seems to be fine, so I see several possible answers:
- Ivy implementation is buggy and doesn't work in your case
- you use a dynamic revision without a long enough TTL
- Ivy doesn't find the cached files on disk for any reason

To clear out what's the exact problem, you need to check Ivy debug log which
should tell what it does with the cache. Post relevant section here if the
logs isn't understandable.

Xavier

> But as you see below an
> attempt was made to redownload the files.
>
> [ivy:resolve] :: resolving dependencies ::
> verisign#smq-perf;working@WAT1RBUCK-L
> 3
> [ivy:resolve]   confs: [default]
> [ivy:resolve] Mar 19, 2008 1:08:10 PM
> org.apache.commons.httpclient.HttpMethodDi
> rector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.ConnectException) caught
> when proces
> sing request: Connection refused: connect
> [ivy:resolve] Mar 19, 2008 1:08:10 PM
> org.apache.commons.httpclient.HttpMethodDi
> rector executeWithRetry
> [ivy:resolve] INFO: Retrying request
> [ivy:resolve] Mar 19, 2008 1:08:11 PM
> org.apache.commons.httpclient.HttpMethodDi
> rector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.ConnectException) caught
> when proces
> sing request: Connection refused: connect
> [ivy:resolve] Mar 19, 2008 1:08:11 PM
> org.apache.commons.httpclient.HttpMethodDi
> rector executeWithRetry
> [ivy:resolve] INFO: Retrying request
> [ivy:resolve] Mar 19, 2008 1:08:12 PM
> org.apache.commons.httpclient.HttpMethodDi
> rector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.ConnectException) caught
> when proces
> sing request: Connection refused: connect
> [ivy:resolve] Mar 19, 2008 1:08:12 PM
> org.apache.commons.httpclient.HttpMethodDi
> rector executeWithRetry
> [ivy:resolve] INFO: Retrying request
> [ivy:resolve] Mar 19, 2008 1:08:14 PM
> org.apache.commons.httpclient.HttpMethodDi
> rector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.ConnectException) caught
> when proces
>
> Am I missing something in my configuration that would enable the
> behavior that I am seeking?
>
> The configuration is provided below.
>
> Thanks in advance,
>
> Bob
>
>
> <?xml version="1.0"?>
> <ivysettings>
>  <settings defaultResolver="default-chain"/>
>  <property name="ivy.volatile.repository"
> value="${workspace.root}/ivy/repos/volatile" override="false"/>
>  <property name="ivy.isolated.repository"
> value="${sandbox.root}/ivy/repos/isolated" override="false"/>
>  <caches useOrigin="true"
> resolutionCacheDir="${workspace.root}/ivy/cache/resolution"
> repositoryCacheDir="${workspace.root}/ivy/cache/repository">
>    <cache name="download-cache" lockStrategy="artifact-lock"
> basedir="${sandbox.root}/ivy/cache/download"/>
>  </caches>
>  <resolvers>
>    <filesystem name="volatile-resolver">
>      <ivy
> pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision]/i
> vys/ivy-[revision].xml"/>
>      <artifact
> pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision]/[
> type]s/[artifact].[ext]"/>
>      <artifact
> pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision]/[
> type]s/[artifact]-[revision].[ext]"/>
>    </filesystem>
>    <filesystem name="isolated-resolver">
>      <ivy
> pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision]/i
> vys/ivy-[revision].xml"/>
>      <artifact
> pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision]/[
> type]s/[artifact].[ext]"/>
>      <artifact
> pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision]/[
> type]s/[artifact]-[revision].[ext]"/>
>    </filesystem>
>    <url name="download-resolver" cache="download-cache">
>      <ivy
> pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revision<http://localhost:37373/ivyrep/%5Borganisation%5D/%5Bmodule%5D/%5Brevision>
> ]/ivys/ivy-[revision].xml"/>
>      <artifact
> pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revision<http://localhost:37373/ivyrep/%5Borganisation%5D/%5Bmodule%5D/%5Brevision>
> ]/[type]s/[artifact].[ext]"/>
>      <artifact
> pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revision<http://localhost:37373/ivyrep/%5Borganisation%5D/%5Bmodule%5D/%5Brevision>
> ]/[type]s/[artifact]-[revision].[ext]"/>
>    </url>
>    <chain name="default-chain" returnFirst="true">
>      <resolver ref="volatile-resolver"/>
>      <resolver ref="isolated-resolver"/>
>      <resolver ref="download-resolver"/>
>    </chain>
>  </resolvers>
> </ivysettings>
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/