Re: Proposed changes for IVY-735 - Ability to specify timeouts

2017-07-14 Thread Gintautas Grigelionis
my €.02 : currently, all resolvers only have artifact patterns as child
elements, so I'd rather have the timeouts as attributes that might use
references, similarly to cache managers or latest strategies. That would
imply a global default that may be overridden individually.

Gintas

2017-07-14 13:34 GMT+02:00 :

> https://issues.apache.org/jira/browse/IVY-735 is a feature request where
> the users have asked for relevant timeouts while dealing with downloads. A
> few weeks back we had a very brief discussion in an unrelated mail where it
> was proposed that we allow configuring these timeout all the way from ivy
> settings.
>
> I have an initial proposal/attempt to implement this feature. The initial
> changes are here in my personal repo[1]. It's a work in progress commit
> which sets up the necessary interfaces and the flow to show what I have in
> mind. Before proceeding further, I would like some inputs on whether this
> looks fine. Here's a summary of what the changes are going to be:
>
> - Each (dependency) resolver will have the ability to specify "timeout
> constraints"[2].
>
> - These timeout constraints will be specified while defining the resolver
> in the ivy settings file. Imagine something like:
>
> 
>
> 
>
> 
>
>  read-timeout=""/>
>
> 
>
> 
>
> - Each of the resolver will then use these timeout constraints (if
> specified) while resolving the module descriptor and downloading the
> artifacts and dealing with those resources.
>
> - The absence of the timeout constraints will let the resolvers behave the
> way they do currently
>
> The changes in the linked commit deprecate some APIs which weren't using
> timeouts and are replaced by APIs which pass along (an optional)
> TimeoutConstraints[2].
>
> In summary, the change being proposed is that (dependency) resolvers have
> the ability to specify these timeout constraints and then use them while
> dealing with module descriptors and artifacts. One thing I have (to some
> extent intentionally) left out is the ability to define a global Ivy
> settings level or "all resolvers" level timeout-constraints. That's because
> I'm not too sure if it adds much value instead of defining it at individual
> resolver level. I'm however open to adding that support as well.
>
> The linked commit currently doesn't have the necessary support for parsing
> these additional XML elements, but if this whole approach looks fine, I
> will take this further and make sure things work as expected.
>
> [1] https://github.com/jaikiran/ant-ivy/commit/e501d9deca78db8b9
> 34f8a2710ebcfeaeb1456c8
>
> [2] https://github.com/jaikiran/ant-ivy/commit/e501d9deca78db8b9
> 34f8a2710ebcfeaeb1456c8#diff-cd8ed454a52f4afa779574f5600a0ccb
>
>
> -Jaikiran
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
> For additional commands, e-mail: dev-h...@ant.apache.org
>
>


[GitHub] ant-ivy issue #52: Generics in core

2017-07-14 Thread twogee
Github user twogee commented on the issue:

https://github.com/apache/ant-ivy/pull/52
  
I committed proposed changes w/o contains(). Please let me know if should 
amend.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread twogee
Github user twogee commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127480601
  
--- Diff: src/java/org/apache/ivy/osgi/util/VersionRange.java ---
@@ -306,7 +306,7 @@ public boolean isClosedRange() {
 return startVersion.equals(endVersion);
 }
 
-public boolean contains(String versionStr) throws ParseException {
+public boolean contains(String versionStr) {
--- End diff --

Not sure about this one, either: it's a consequence of previous changes to 
Version which no longer throws exceptions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127475255
  
--- Diff: 
src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java ---
@@ -148,7 +142,7 @@ public void put(File source, String destination, 
boolean overwrite) throws IOExc
 }
 }
 
-private void mkdirs(String directory, ChannelSftp c) throws 
IOException, SftpException {
+private void mkdirs(String directory, ChannelSftp c) throws 
SftpException {
--- End diff --

Agree. This change can stay. I missed this while reviewing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread twogee
Github user twogee commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127474316
  
--- Diff: 
src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java ---
@@ -148,7 +142,7 @@ public void put(File source, String destination, 
boolean overwrite) throws IOExc
 }
 }
 
-private void mkdirs(String directory, ChannelSftp c) throws 
IOException, SftpException {
+private void mkdirs(String directory, ChannelSftp c) throws 
SftpException {
--- End diff --

This is a private method...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



Proposed changes for IVY-735 - Ability to specify timeouts

2017-07-14 Thread jaikiran . pai
https://issues.apache.org/jira/browse/IVY-735 is a feature request where 
the users have asked for relevant timeouts while dealing with downloads. 
A few weeks back we had a very brief discussion in an unrelated mail 
where it was proposed that we allow configuring these timeout all the 
way from ivy settings.


I have an initial proposal/attempt to implement this feature. The 
initial changes are here in my personal repo[1]. It's a work in progress 
commit which sets up the necessary interfaces and the flow to show what 
I have in mind. Before proceeding further, I would like some inputs on 
whether this looks fine. Here's a summary of what the changes are going 
to be:


- Each (dependency) resolver will have the ability to specify "timeout 
constraints"[2].


- These timeout constraints will be specified while defining the 
resolver in the ivy settings file. Imagine something like:








read-timeout=""/>






- Each of the resolver will then use these timeout constraints (if 
specified) while resolving the module descriptor and downloading the 
artifacts and dealing with those resources.


- The absence of the timeout constraints will let the resolvers behave 
the way they do currently


The changes in the linked commit deprecate some APIs which weren't using 
timeouts and are replaced by APIs which pass along (an optional) 
TimeoutConstraints[2].


In summary, the change being proposed is that (dependency) resolvers 
have the ability to specify these timeout constraints and then use them 
while dealing with module descriptors and artifacts. One thing I have 
(to some extent intentionally) left out is the ability to define a 
global Ivy settings level or "all resolvers" level timeout-constraints. 
That's because I'm not too sure if it adds much value instead of 
defining it at individual resolver level. I'm however open to adding 
that support as well.


The linked commit currently doesn't have the necessary support for 
parsing these additional XML elements, but if this whole approach looks 
fine, I will take this further and make sure things work as expected.


[1] 
https://github.com/jaikiran/ant-ivy/commit/e501d9deca78db8b934f8a2710ebcfeaeb1456c8


[2] 
https://github.com/jaikiran/ant-ivy/commit/e501d9deca78db8b934f8a2710ebcfeaeb1456c8#diff-cd8ed454a52f4afa779574f5600a0ccb



-Jaikiran


-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



Proposed changes for IVY-735 - Ability to specify timeouts

2017-07-14 Thread Jaikiran Pai
https://issues.apache.org/jira/browse/IVY-735 is a feature request where the 
users have asked for relevant timeouts while dealing with downloads. A few 
weeks back we had a very brief discussion in an unrelated mail where it was 
proposed that we allow configuring these timeout all the way from ivy settings. 

I have an initial proposal/attempt to implement this feature. The initial 
changes are here in my personal repo[1]. It's a work in progress commit which 
sets up the necessary interfaces and the flow to show what I have in mind. 
Before proceeding further, I would like some inputs on whether this looks fine. 
Here's a summary of what the changes are going to be: 

- Each (dependency) resolver will have the ability to specify "timeout 
constraints"[2]. 

- These timeout constraints will be specified while defining the resolver in 
the ivy settings file. Imagine something like: 

 

 

 

 

 

 

- Each of the resolver will then use these timeout constraints (if specified) 
while resolving the module descriptor and downloading the artifacts and dealing 
with those resources. 

- The absence of the timeout constraints will let the resolvers behave the way 
they do currently 

The changes in the linked commit deprecate some APIs which weren't using 
timeouts and are replaced by APIs which pass along (an optional) 
TimeoutConstraints[2]. 

In summary, the change being proposed is that (dependency) resolvers have the 
ability to specify these timeout constraints and then use them while dealing 
with module descriptors and artifacts. One thing I have (to some extent 
intentionally) left out is the ability to define a global Ivy settings level or 
"all resolvers" level timeout-constraints. That's because I'm not too sure if 
it adds much value instead of defining it at individual resolver level. I'm 
however open to adding that support as well. 

The linked commit currently doesn't have the necessary support for parsing 
these additional XML elements, but if this whole approach looks fine, I will 
take this further and make sure things work as expected. 

[1] 
https://github.com/jaikiran/ant-ivy/commit/e501d9deca78db8b934f8a2710ebcfeaeb1456c8
 

[2] 
https://github.com/jaikiran/ant-ivy/commit/e501d9deca78db8b934f8a2710ebcfeaeb1456c8#diff-cd8ed454a52f4afa779574f5600a0ccb
 


-Jaikiran 


-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy issue #52: Generics in core

2017-07-14 Thread twogee
Github user twogee commented on the issue:

https://github.com/apache/ant-ivy/pull/52
  
Thanks! I will revert the changes regarding the checked exceptions as 
suggested in a separate commit.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread twogee
Github user twogee commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127408025
  
--- Diff: 
src/java/org/apache/ivy/tools/analyser/JarJarDependencyAnalyser.java ---
@@ -39,21 +39,22 @@ public JarJarDependencyAnalyser(File jarjarjarLocation) 
{
 }
 
 public ModuleDescriptor[] analyze(JarModule[] modules) {
-
 StringBuilder jarjarCmd = new StringBuilder("java -jar \"").append(
 jarjarjarLocation.getAbsolutePath()).append("\" --find 
--level=jar ");
 Map jarModulesMap = new HashMap<>();
 Map mds = new 
HashMap<>();
 
-for (int i = 0; i < modules.length; i++) {
-jarModulesMap.put(modules[i].getJar().getAbsolutePath(), 
modules[i]);
+for (JarModule jarModule : modules) {
+jarModulesMap.put(jarModule.getJar().getAbsolutePath(), 
jarModule);
 DefaultModuleDescriptor md = 
DefaultModuleDescriptor.newBasicInstance(
-modules[i].getMrid(), new 
Date(modules[i].getJar().lastModified()));
-mds.put(modules[i].getMrid(), md);
-
jarjarCmd.append("\"").append(modules[i].getJar().getAbsolutePath()).append("\"");
-if (i + 1 < modules.length) {
-jarjarCmd.append(File.pathSeparator);
-}
+jarModule.getMrid(), new 
Date(jarModule.getJar().lastModified()));
+mds.put(jarModule.getMrid(), md);
+
jarjarCmd.append("\"").append(jarModule.getJar().getAbsolutePath()).append("\"");
+jarjarCmd.append(File.pathSeparator);
+}
+
+if (modules.length > 0) {
+jarjarCmd.setLength(jarjarCmd.length() - 1);
--- End diff --

It strips an extra pathSeparator character, but only if modules has any 
entries. It is an afterthought on my part...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy issue #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on the issue:

https://github.com/apache/ant-ivy/pull/52
  
I've reviewed this PR and apart from the review comments noted, the rest of 
the changes look fine. Please only include any review comments related changes 
to this PR, from now on. Else it's going to take a massive effort to review 
this PR afresh again. Also, while doing any new review comments related changes 
to this specific PR, please do them in new commits - that way, I'll know 
existing commits haven't changed. While merging upstream, I'll make sure that I 
squash those commits myself.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127398802
  
--- Diff: src/java/org/apache/ivy/util/url/HttpClientHandler.java ---
@@ -177,7 +177,7 @@ public URLInfo getURLInfo(URL url, int timeout) {
 return UNAVAILABLE;
 }
 
-private boolean checkStatusCode(URL url, HttpMethodBase method) throws 
IOException {
+private boolean checkStatusCode(URL url, HttpMethodBase method) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127398451
  
--- Diff: 
src/java/org/apache/ivy/tools/analyser/JarJarDependencyAnalyser.java ---
@@ -39,21 +39,22 @@ public JarJarDependencyAnalyser(File jarjarjarLocation) 
{
 }
 
 public ModuleDescriptor[] analyze(JarModule[] modules) {
-
 StringBuilder jarjarCmd = new StringBuilder("java -jar \"").append(
 jarjarjarLocation.getAbsolutePath()).append("\" --find 
--level=jar ");
 Map jarModulesMap = new HashMap<>();
 Map mds = new 
HashMap<>();
 
-for (int i = 0; i < modules.length; i++) {
-jarModulesMap.put(modules[i].getJar().getAbsolutePath(), 
modules[i]);
+for (JarModule jarModule : modules) {
+jarModulesMap.put(jarModule.getJar().getAbsolutePath(), 
jarModule);
 DefaultModuleDescriptor md = 
DefaultModuleDescriptor.newBasicInstance(
-modules[i].getMrid(), new 
Date(modules[i].getJar().lastModified()));
-mds.put(modules[i].getMrid(), md);
-
jarjarCmd.append("\"").append(modules[i].getJar().getAbsolutePath()).append("\"");
-if (i + 1 < modules.length) {
-jarjarCmd.append(File.pathSeparator);
-}
+jarModule.getMrid(), new 
Date(jarModule.getJar().lastModified()));
+mds.put(jarModule.getMrid(), md);
+
jarjarCmd.append("\"").append(jarModule.getJar().getAbsolutePath()).append("\"");
+jarjarCmd.append(File.pathSeparator);
+}
+
+if (modules.length > 0) {
+jarjarCmd.setLength(jarjarCmd.length() - 1);
--- End diff --

I don't fully follow what this is block is meant for. Is it to 
conditionally include the `File.pathSeparator` character?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127397658
  
--- Diff: src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java ---
@@ -263,9 +263,8 @@ public void clearSession(Session session) {
  * @param session
  *to connect to
  * @return channelSftp or null if not successful (channel not existent 
or dead)
- * @throws IOException if something goes wrong
  */
-public ChannelSftp getChannelSftp(Session session) throws IOException {
+public ChannelSftp getChannelSftp(Session session) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127397389
  
--- Diff: 
src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java ---
@@ -148,7 +142,7 @@ public void put(File source, String destination, 
boolean overwrite) throws IOExc
 }
 }
 
-private void mkdirs(String directory, ChannelSftp c) throws 
IOException, SftpException {
+private void mkdirs(String directory, ChannelSftp c) throws 
SftpException {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127396424
  
--- Diff: src/java/org/apache/ivy/osgi/util/VersionRange.java ---
@@ -306,7 +306,7 @@ public boolean isClosedRange() {
 return startVersion.equals(endVersion);
 }
 
-public boolean contains(String versionStr) throws ParseException {
+public boolean contains(String versionStr) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127396341
  
--- Diff: src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java 
---
@@ -59,11 +59,11 @@ protected InputStream getInputStream(String f) throws 
IOException {
 return repo.getResource(f).openStream();
 }
 
-protected List listBundleFiles(String dir) throws IOException {
+protected List listBundleFiles(String dir) {
 return asList(ResolverHelper.listAll(repo, dir));
 }
 
-protected List listDirs(String dir) throws IOException {
+protected List listDirs(String dir) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127396320
  
--- Diff: src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java 
---
@@ -59,11 +59,11 @@ protected InputStream getInputStream(String f) throws 
IOException {
 return repo.getResource(f).openStream();
 }
 
-protected List listBundleFiles(String dir) throws IOException {
+protected List listBundleFiles(String dir) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org