[BEAM-596] Support waitUntilFinish, cancel in the DirectRunner#1115
[BEAM-596] Support waitUntilFinish, cancel in the DirectRunner#1115asfgit merged 1 commit intoapache:masterfrom
Conversation
|
Jenkins failure is unrelated (in spark) |
|
R: @peihe |
| * waiting thread and rethrows it | ||
| */ | ||
| void awaitCompletion() throws Exception; | ||
| State awaitCompletion(Duration duration) throws Exception; |
| * waiting thread and rethrows it | ||
| */ | ||
| void awaitCompletion() throws Exception; | ||
| State awaitCompletion(Duration duration) throws Exception; |
| } while (update == null || !update.isDone()); | ||
| } | ||
| if (update == null || update.getNewState() == null) { | ||
| return executorService.isShutdown() ? State.UNKNOWN : State.RUNNING; |
There was a problem hiding this comment.
Since we control the executorService, could we make sure it provides the state when it is shutting down?
| @Override | ||
| public State cancel() { | ||
| executor.stop(); | ||
| return waitUntilFinish(); |
There was a problem hiding this comment.
any reason that the blocking logic is not in stop()?
There was a problem hiding this comment.
This logic shouldn't really be present at all - this dispatches a call to the executor to shut it down, and then returns immediately. If the proper behavior includes waiting to finish, the call to waitToFinish should be explicit.
stop will stop the executor from starting any more work, but need not immediately shut down any in-progress work (but should work towards turning down any active work)
475eb11 to
f64ed31
Compare
tgroh
left a comment
There was a problem hiding this comment.
This has been expanded slightly, and has been made much more resilient.
Additionally, the performance regression that it introduced has been mitigated. The call to BlockingQueue#poll(Timeout) appears to wait for the entire timeout duration if there is no element when initially called, which causes the Pipeline to wait for an extended period of time if the pipeline completes very quickly.
| @Override | ||
| public State cancel() { | ||
| executor.stop(); | ||
| return waitUntilFinish(); |
There was a problem hiding this comment.
This logic shouldn't really be present at all - this dispatches a call to the executor to shut it down, and then returns immediately. If the proper behavior includes waiting to finish, the call to waitToFinish should be explicit.
stop will stop the executor from starting any more work, but need not immediately shut down any in-progress work (but should work towards turning down any active work)
| } while (update == null || !update.isDone()); | ||
| } | ||
| if (update == null || update.getNewState() == null) { | ||
| return executorService.isShutdown() ? State.UNKNOWN : State.RUNNING; |
|
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 5549 lines...] at hudson.remoting.UserRequest.perform(UserRequest.java:153) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:332) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: org.apache.maven.plugin.MojoFailureException: You have 1 Checkstyle violation. at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:588) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 31 more2016-12-22T23:46:28.577 [ERROR] 2016-12-22T23:46:28.577 [ERROR] Re-run Maven using the -X switch to enable full debug logging.2016-12-22T23:46:28.577 [ERROR] 2016-12-22T23:46:28.577 [ERROR] For more information about the errors and possible solutions, please read the following articles:2016-12-22T23:46:28.577 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException2016-12-22T23:46:28.577 [ERROR] 2016-12-22T23:46:28.577 [ERROR] After correcting the problems, you can resume the build with the command2016-12-22T23:46:28.577 [ERROR] mvn -rf :beam-runners-direct-javachannel stoppedSetting status of f64ed31 to FAILURE with url https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6234/ and message: 'Build finished. 'Using context: Jenkins: Maven clean install--none-- |
|
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 5548 lines...] at hudson.remoting.UserRequest.perform(UserRequest.java:153) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:332) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: org.apache.maven.plugin.MojoFailureException: You have 1 Checkstyle violation. at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:588) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 31 more2016-12-22T23:47:16.325 [ERROR] 2016-12-22T23:47:16.326 [ERROR] Re-run Maven using the -X switch to enable full debug logging.2016-12-22T23:47:16.326 [ERROR] 2016-12-22T23:47:16.326 [ERROR] For more information about the errors and possible solutions, please read the following articles:2016-12-22T23:47:16.326 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException2016-12-22T23:47:16.326 [ERROR] 2016-12-22T23:47:16.327 [ERROR] After correcting the problems, you can resume the build with the command2016-12-22T23:47:16.327 [ERROR] mvn -rf :beam-runners-direct-javachannel stoppedSetting status of 475eb11 to FAILURE with url https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6232/ and message: 'Build finished. 'Using context: Jenkins: Maven clean install--none-- |
a200c72 to
be9a1ec
Compare
|
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 5579 lines...] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:230) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:242) at org.codehaus.mojo.findbugs.FindbugsViolationCheckMojo.execute(FindbugsViolationCheckMojo.groovy:530) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 31 more2016-12-23T00:41:14.387 [ERROR] 2016-12-23T00:41:14.387 [ERROR] Re-run Maven using the -X switch to enable full debug logging.2016-12-23T00:41:14.387 [ERROR] 2016-12-23T00:41:14.387 [ERROR] For more information about the errors and possible solutions, please read the following articles:2016-12-23T00:41:14.387 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException2016-12-23T00:41:14.387 [ERROR] 2016-12-23T00:41:14.387 [ERROR] After correcting the problems, you can resume the build with the command2016-12-23T00:41:14.387 [ERROR] mvn -rf :beam-runners-direct-javachannel stoppedSetting status of a200c72 to FAILURE with url https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6238/ and message: 'Build finished. 'Using context: Jenkins: Maven clean install--none-- |
|
Refer to this link for build results (access rights to CI server needed): |
be9a1ec to
62b46cf
Compare
|
@peihe This is ready to review again. |
|
Refer to this link for build results (access rights to CI server needed): |
62b46cf to
703e4ea
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Any updates? |
|
No updates from my end. I'm happy to merge as-is or reassign reviewers. |
|
R: @kennknowles |
|
LGTM |
703e4ea to
caacf29
Compare
|
Refer to this link for build results (access rights to CI server needed): |
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull requestmvn clean verify. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
<Jira issue #>in the title with the actual Jira issuenumber, if there is one.
Individual Contributor License Agreement.