You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by apupier <gi...@git.apache.org> on 2018/01/05 08:24:36 UTC

[GitHub] ant-ivy pull request #62: IVY-1572 - Check for Thread interruption while res...

GitHub user apupier opened a pull request:

    https://github.com/apache/ant-ivy/pull/62

    IVY-1572 - Check for Thread interruption while resolving resources

    Signed-off-by: Aurélien Pupier <ap...@redhat.com>

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apupier/ant-ivy IVY-1572-CheckForInterruptionDuringLongRunningOperations

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ant-ivy/pull/62.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #62
    
----
commit ed2666f48b7783d95b75f59314baf08994fb0948
Author: Aurélien Pupier <ap...@...>
Date:   2018-01-05T08:22:15Z

    IVY-1572 - Check for Thread interruption while resolving resources
    
    Signed-off-by: Aurélien Pupier <ap...@redhat.com>

----


---

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


[GitHub] ant-ivy pull request #62: IVY-1572 - Check for Thread interruption while res...

Posted by jaikiran <gi...@git.apache.org>.
Github user jaikiran commented on a diff in the pull request:

    https://github.com/apache/ant-ivy/pull/62#discussion_r166282397
  
    --- Diff: src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java ---
    @@ -91,6 +91,9 @@ protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId moduleRevi
             Set<String> foundRevisions = new HashSet<>();
             boolean dynamic = getSettings().getVersionMatcher().isDynamic(moduleRevision);
             for (String pattern : patternList) {
    +            if (Thread.currentThread().isInterrupted()) {
    +                return null;
    --- End diff --
    
    @apupier , I don't think this is the best place to check the thread interruption, but I don't have a better suggestion right now, so unless someone objects, this change is probably fine. However, instead of returning null, can you please throw a (runtime) exception instead.


---

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


[GitHub] ant-ivy pull request #62: IVY-1572 - Check for Thread interruption while res...

Posted by jaikiran <gi...@git.apache.org>.
Github user jaikiran commented on a diff in the pull request:

    https://github.com/apache/ant-ivy/pull/62#discussion_r167136873
  
    --- Diff: src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java ---
    @@ -91,6 +91,9 @@ protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId moduleRevi
             Set<String> foundRevisions = new HashSet<>();
             boolean dynamic = getSettings().getVersionMatcher().isDynamic(moduleRevision);
             for (String pattern : patternList) {
    +            if (Thread.currentThread().isInterrupted()) {
    +                return null;
    --- End diff --
    
    @apupier I originally intended it to be `InterruptedException` but given that it's a checked exception you would end up changing the method signature of this method which then causes issues with callers of this API. Hence I suggested a runtime exception.  Returning null  could have other (side) effects than what you intend here - i.e. to abort the execution, so throwing the exception would be the right thing.
    
    I might have some time tonight, I'll see if this check can be moved to a better location or handle in a better way. 


---

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


[GitHub] ant-ivy pull request #62: IVY-1572 - Check for Thread interruption while res...

Posted by apupier <gi...@git.apache.org>.
Github user apupier commented on a diff in the pull request:

    https://github.com/apache/ant-ivy/pull/62#discussion_r166349423
  
    --- Diff: src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java ---
    @@ -91,6 +91,9 @@ protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId moduleRevi
             Set<String> foundRevisions = new HashSet<>();
             boolean dynamic = getSettings().getVersionMatcher().isDynamic(moduleRevision);
             for (String pattern : patternList) {
    +            if (Thread.currentThread().isInterrupted()) {
    +                return null;
    --- End diff --
    
    the specific exception in this case is in theory https://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html which is a checked Exception.
    Do you have another runtime exception in mind? Or you want to create a specific Runtime Exception? I'm wondering what would be the effect in this case to Thread in which it has been launched. Will it finished also?


---

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


[GitHub] ant-ivy issue #62: IVY-1572 - Check for Thread interruption while resolving ...

Posted by apupier <gi...@git.apache.org>.
Github user apupier commented on the issue:

    https://github.com/apache/ant-ivy/pull/62
  
    thee error on Ci has nothign to do with the PR:
    
    > 08:25:29 GitHub pull request #62 to apache/ant-ivy
    08:25:32 [EnvInject] - Loading node environment variables.
    08:25:32 Building remotely on H30 (ubuntu xenial) in workspace /home/jenkins/jenkins-slave/workspace/Ivy-GithubPR
    08:25:32 java.io.IOException: Failed to mkdirs: /home/jenkins/jenkins-slave/workspace/Ivy-GithubPR
    08:25:32 	at hudson.FilePath.mkdirs(FilePath.java:1170)
    08:25:32 	at hudson.model.AbstractProject.checkout(AbstractProject.java:1200)
    08:25:32 	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
    08:25:32 	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    08:25:32 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
    08:25:32 	at hudson.model.Run.execute(Run.java:1724)
    08:25:32 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    08:25:32 	at hudson.model.ResourceController.execute(ResourceController.java:97)
    08:25:32 	at hudson.model.Executor.run(Executor.java:421)
    08:25:32 Retrying after 10 seconds
    08:25:42 java.io.IOException: Failed to mkdirs: /home/jenkins/jenkins-slave/workspace/Ivy-GithubPR
    08:25:42 	at hudson.FilePath.mkdirs(FilePath.java:1170)
    08:25:42 	at hudson.model.AbstractProject.checkout(AbstractProject.java:1200)
    08:25:42 	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
    08:25:42 	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    08:25:42 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
    08:25:42 	at hudson.model.Run.execute(Run.java:1724)
    08:25:42 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    08:25:42 	at hudson.model.ResourceController.execute(ResourceController.java:97)
    08:25:42 	at hudson.model.Executor.run(Executor.java:421)
    08:25:42 Retrying after 10 seconds
    08:25:53 java.io.IOException: Failed to mkdirs: /home/jenkins/jenkins-slave/workspace/Ivy-GithubPR
    08:25:53 	at hudson.FilePath.mkdirs(FilePath.java:1170)
    08:25:53 	at hudson.model.AbstractProject.checkout(AbstractProject.java:1200)
    08:25:53 	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
    08:25:53 	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    08:25:53 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
    08:25:53 	at hudson.model.Run.execute(Run.java:1724)
    08:25:53 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    08:25:53 	at hudson.model.ResourceController.execute(ResourceController.java:97)
    08:25:53 	at hudson.model.Executor.run(Executor.java:421)
    08:25:53 Recording test results
    08:25:53 ERROR: Build step failed with exception
    08:25:53 Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to H30
    08:25:53 		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
    08:25:53 		at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
    08:25:53 		at hudson.remoting.Channel.call(Channel.java:908)
    08:25:53 		at hudson.FilePath.act(FilePath.java:986)
    08:25:53 		at hudson.FilePath.act(FilePath.java:975)
    08:25:53 		at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:114)
    08:25:53 		at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:136)
    08:25:53 		at hudson.tasks.junit.JUnitResultArchiver.parseAndAttach(JUnitResultArchiver.java:166)
    08:25:53 		at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:153)
    08:25:53 		at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
    08:25:53 		at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    08:25:53 		at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
    08:25:53 		at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
    08:25:53 		at hudson.model.Build$BuildExecution.post2(Build.java:186)
    08:25:53 		at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
    08:25:53 		at hudson.model.Run.execute(Run.java:1749)
    08:25:53 		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    08:25:53 		at hudson.model.ResourceController.execute(ResourceController.java:97)
    08:25:53 		at hudson.model.Executor.run(Executor.java:421)
    08:25:53 /home/jenkins/jenkins-slave/workspace/Ivy-GithubPR does not exist.
    08:25:53 	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
    08:25:53 	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
    08:25:53 	at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:141)
    08:25:53 	at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:118)
    08:25:53 	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2760)
    08:25:53 	at hudson.remoting.UserRequest.perform(UserRequest.java:207)
    08:25:53 	at hudson.remoting.UserRequest.perform(UserRequest.java:53)
    08:25:53 	at hudson.remoting.Request$2.run(Request.java:358)
    08:25:53 	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    08:25:53 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    08:25:53 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    08:25:53 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    08:25:53 	at java.lang.Thread.run(Thread.java:748)
    08:25:53 Build step 'Publish JUnit test result report' marked build as failure
    08:25:53 Putting comment on the pull request
    08:25:54 Finished: FAILURE


---

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


[GitHub] ant-ivy issue #62: IVY-1572 - Check for Thread interruption while resolving ...

Posted by apupier <gi...@git.apache.org>.
Github user apupier commented on the issue:

    https://github.com/apache/ant-ivy/pull/62
  
    Seems that there was an issue with the Jenkins webhook.
    Jan Matèrne mentioned that the build was in success https://issues.apache.org/jira/browse/IVY-1572?focusedCommentId=16316345&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16316345



---

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