Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encapsulate-non-helix-job-launch-logic #2193

Closed

Conversation

HappyRay
Copy link
Contributor

@HappyRay HappyRay commented Dec 8, 2017

[GOBBLIN-336] Encapsulate the non-Helix specific task execution logic

Put the logic in its own class.

Also changed:

  • Use a try-with statement to close the global broker.
  • Fix a Helix warning: ERROR is replaced with FAILED.

Testing:

The integration test org.apache.gobblin.cluster.ClusterIntegrationTest
passed.

@HappyRay
Copy link
Contributor Author

HappyRay commented Dec 8, 2017

Depends on #2191

@abti
Copy link
Member

abti commented Dec 8, 2017

@HappyRay Seems like there are code conflicts, please resolve them.

Put the logic in its own class.

Testing:

The integration test org.apache.gobblin.cluster.ClusterIntegrationTest
passed.
@HappyRay HappyRay force-pushed the encapsulate-non-helix-job-launch-logic branch from 4193941 to 92c2313 Compare December 8, 2017 15:53
@HappyRay
Copy link
Contributor Author

HappyRay commented Dec 8, 2017

Resolved.
@abti

@HappyRay
Copy link
Contributor Author

HappyRay commented Dec 8, 2017

Here is the test failure.

Looks like a flaky test to me.

Gradle suite > Gradle test > org.apache.gobblin.rest.JobExecutionInfoServerTest. STARTED

Gradle suite > Gradle test > org.apache.gobblin.rest.JobExecutionInfoServerTest. FAILED
com.linkedin.r2.RemoteInvocationException at JobExecutionInfoServerTest.java:109
Caused by: com.linkedin.r2.RemoteInvocationException
Caused by: com.linkedin.r2.RetriableRequestException
Caused by: java.net.ConnectException

Gradle suite > Gradle test > org.apache.gobblin.rest.JobExecutionInfoServerTest. STARTED

Gradle suite > Gradle test > org.apache.gobblin.rest.JobExecutionInfoServerTest. FAILED
com.linkedin.r2.RemoteInvocationException at JobExecutionInfoServerTest.java:124
Caused by: com.linkedin.r2.RemoteInvocationException
Caused by: com.linkedin.r2.RetriableRequestException
Caused by: java.net.ConnectException

Gradle suite > Gradle test > org.apache.gobblin.rest.JobExecutionInfoServerTest. STARTED

Gradle suite > Gradle test > org.apache.gobblin.rest.JobExecutionInfoServerTest. FAILED
com.linkedin.r2.RemoteInvocationException at JobExecutionInfoServerTest.java:96
Caused by: com.linkedin.r2.RemoteInvocationException
Caused by: com.linkedin.r2.RetriableRequestException
Caused by: java.net.ConnectException

3 tests completed, 3 failed
:gobblin-rest-service:gobblin-rest-server:test FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':gobblin-rest-service:gobblin-rest-server:test'.

There were failing tests. See the report at: file:///home/travis/build/apache/incubator-gobblin/build/gobblin-rest-server/reports/tests/index.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15 mins 36.995 secs

idl compatibility report:
Incompatible changes:

  1. Resource for "/home/travis/build/apache/incubator-gobblin/gobblin-rest-service/gobblin-rest-api/src/main/snapshot/org.apache.gobblin.rest.jobExecutions.snapshot.json" is not found. This endpoint will not be released. Please remove this file and build again
  2. Resource for "/home/travis/build/apache/incubator-gobblin/gobblin-rest-service/gobblin-rest-api/src/main/idl/org.apache.gobblin.rest.jobExecutions.restspec.json" is not found. This endpoint will not be released. Please remove this file and build again

[RS-I]:Resource for "/home/travis/build/apache/incubator-gobblin/gobblin-rest-service/gobblin-rest-api/src/main/snapshot/org.apache.gobblin.rest.jobExecutions.snapshot.json" is not found. This endpoint will not be released. Please remove this file and build again
[RS-I]:Resource for "/home/travis/build/apache/incubator-gobblin/gobblin-rest-service/gobblin-rest-api/src/main/idl/org.apache.gobblin.rest.jobExecutions.restspec.json" is not found. This endpoint will not be released. Please remove this file and build again

travis_time:end:0c852a20:start=1512748975620375525,finish=1512749913137284912,duration=937516909387
�[0K
�[31;1mThe command "./travis/test.sh" exited with 1.�[0m
travis_fold:start:before_cache
�[0Ktravis_time:start:17255fcd
�[0K$ rm -f $HOME/.gradle/caches/modules-2/modules-2.lock

travis_time:end:17255fcd:start=1512749913147336308,finish=1512749913156772809,duration=9436501
�[0Ktravis_fold:end:before_cache
�[0Ktravis_fold:start:cache.2
�[0Kstore build cache
travis_time:start:0d43d8d6
�[0K
travis_time:end:0d43d8d6:start=1512749913165757731,finish=1512749913172802439,duration=7044708
�[0Ktravis_time:start:22b4ecd7
�[0K/home/travis/.casher/bin/casher:219: warning: Insecure world writable dir /home/travis in PATH, mode 040777
�[32;1mchange detected (content changed, file is created, or file is deleted):
/home/travis/.gradle/caches/2.13/plugin-resolution/cache.properties.lock

�[0m
�[32;1mchanges detected, packing new archive�[0m
.
.
.
�[32;1muploading archive�[0m

travis_time:end:22b4ecd7:start=1512749913182234549,finish=1512749942560795801,duration=29378561252
�[0Ktravis_fold:end:cache.2
�[0Ktravis_fold:start:after_failure
�[0Ktravis_time:start:1303419c
�[0K$ ./travis/junit-errors-to-stdout.sh
Formatting results...
Formatting ./build/gobblin-rest-server/test-results/TEST-org.apache.gobblin.rest.JobExecutionInfoServerTest.xml

Testsuite: org.apache.gobblin.rest.JobExecutionInfoServerTest
Tests run: 3, Failures: 3, Errors: 0, Time elapsed: 1.324 sec


Testcase: took 0.417 FAILURE
com.linkedin.r2.RemoteInvocationException: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions/($params:(),id:(string:TestJob1_15127499107671),idType:JOB_ID) com.linkedin.r2.RemoteInvocationException
com.linkedin.r2.RemoteInvocationException: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions/($params:(),id:(string:TestJob1_15127499107671),idType:JOB_ID)
at com.linkedin.restli.internal.client.ExceptionUtil.wrapThrowable(ExceptionUtil.java:135)
at com.linkedin.restli.internal.client.ResponseFutureImpl.getResponseImpl(ResponseFutureImpl.java:130)
at com.linkedin.restli.internal.client.ResponseFutureImpl.getResponse(ResponseFutureImpl.java:94)
at org.apache.gobblin.rest.JobExecutionInfoClient.get(JobExecutionInfoClient.java:73)
at org.apache.gobblin.rest.JobExecutionInfoServerTest.testBadGet(JobExecutionInfoServerTest.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:133)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:83)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.stop(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:364)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions/($params:(),id:(string:TestJob1_15127499107671),idType:JOB_ID)
at com.linkedin.r2.transport.http.common.HttpBridge$1.onResponse(HttpBridge.java:65)
at com.linkedin.r2.transport.http.client.ExecutionCallback$1.run(ExecutionCallback.java:68)
at io.netty.util.concurrent.SingleThreadEventExecutor.safeExecute(SingleThreadEventExecutor.java:451)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:401)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
... 1 more
Caused by: com.linkedin.r2.RetriableRequestException: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:87)
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:64)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:129)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:588)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:512)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:426)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:398)
... 2 more
Caused by: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:323)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
... 6 more

Testcase: took 0.289 FAILURE
com.linkedin.r2.RemoteInvocationException: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions?ids=List(($params:(),id:(string:TestJob1_1512749910767),idType:JOB_ID),($params:(),id:(string:TestJob2_1512749910820),idType:JOB_ID)) com.linkedin.r2.RemoteInvocationException
com.linkedin.r2.RemoteInvocationException: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions?ids=List(($params:(),id:(string:TestJob1_1512749910767),idType:JOB_ID),($params:(),id:(string:TestJob2_1512749910820),idType:JOB_ID))
at com.linkedin.restli.internal.client.ExceptionUtil.wrapThrowable(ExceptionUtil.java:135)
at com.linkedin.restli.internal.client.ResponseFutureImpl.getResponseImpl(ResponseFutureImpl.java:130)
at com.linkedin.restli.internal.client.ResponseFutureImpl.getResponse(ResponseFutureImpl.java:94)
at com.linkedin.restli.internal.client.ResponseFutureImpl.getResponseEntity(ResponseFutureImpl.java:173)
at org.apache.gobblin.rest.JobExecutionInfoClient.batchGet(JobExecutionInfoClient.java:102)
at org.apache.gobblin.rest.JobExecutionInfoServerTest.testBatchGet(JobExecutionInfoServerTest.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:133)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:83)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.stop(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:364)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions?ids=List(($params:(),id:(string:TestJob1_1512749910767),idType:JOB_ID),($params:(),id:(string:TestJob2_1512749910820),idType:JOB_ID))
at com.linkedin.r2.transport.http.common.HttpBridge$1.onResponse(HttpBridge.java:65)
at com.linkedin.r2.transport.http.client.ExecutionCallback$1.run(ExecutionCallback.java:68)
at io.netty.util.concurrent.SingleThreadEventExecutor.safeExecute(SingleThreadEventExecutor.java:451)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:401)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
... 1 more
Caused by: com.linkedin.r2.RetriableRequestException: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:87)
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:64)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:129)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:588)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:512)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:426)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:398)
... 2 more
Caused by: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:323)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
... 6 more

Testcase: took 0.614 FAILURE
com.linkedin.r2.RemoteInvocationException: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions/($params:(),id:(string:TestJob1_1512749910767),idType:JOB_ID) com.linkedin.r2.RemoteInvocationException
com.linkedin.r2.RemoteInvocationException: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions/($params:(),id:(string:TestJob1_1512749910767),idType:JOB_ID)
at com.linkedin.restli.internal.client.ExceptionUtil.wrapThrowable(ExceptionUtil.java:135)
at com.linkedin.restli.internal.client.ResponseFutureImpl.getResponseImpl(ResponseFutureImpl.java:130)
at com.linkedin.restli.internal.client.ResponseFutureImpl.getResponse(ResponseFutureImpl.java:94)
at org.apache.gobblin.rest.JobExecutionInfoClient.get(JobExecutionInfoClient.java:73)
at org.apache.gobblin.rest.JobExecutionInfoServerTest.testGet(JobExecutionInfoServerTest.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:133)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:83)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.stop(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:364)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.linkedin.r2.RemoteInvocationException: Failed to get response from server for URI http://localhost:37342/jobExecutions/($params:(),id:(string:TestJob1_1512749910767),idType:JOB_ID)
at com.linkedin.r2.transport.http.common.HttpBridge$1.onResponse(HttpBridge.java:65)
at com.linkedin.r2.transport.http.client.ExecutionCallback$1.run(ExecutionCallback.java:68)
at io.netty.util.concurrent.SingleThreadEventExecutor.safeExecute(SingleThreadEventExecutor.java:451)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:401)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
... 1 more
Caused by: com.linkedin.r2.RetriableRequestException: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:87)
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:64)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:129)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:588)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:512)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:426)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:398)
... 2 more
Caused by: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:323)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
... 6 more

------ Standard output ------
ERROR [AsyncPoolImpl] localhost/127.0.0.1:37342 HTTP connection pool: object creation failed
com.linkedin.r2.RetriableRequestException: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:87)
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:64)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:129)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:588)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:512)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:426)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:398)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:323)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
... 6 more
ERROR [AsyncPoolImpl] localhost/127.0.0.1:37342 HTTP connection pool: object creation failed
com.linkedin.r2.RetriableRequestException: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:87)
at com.linkedin.r2.transport.http.client.ChannelPoolLifecycle$1.operationComplete(ChannelPoolLifecycle.java:64)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:129)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:588)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:512)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:426)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:398)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused: localhost/127.0.0.1:37342
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:323)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
... 6 more

------ Error output ------

@HappyRay
Copy link
Contributor Author

HappyRay commented Dec 8, 2017

All three tests passed locally.

@abti
Copy link
Member

abti commented Dec 8, 2017

@htran1 Please review, this might impact your work with MySQL store usage.

@HappyRay HappyRay closed this Dec 8, 2017
@HappyRay HappyRay reopened this Dec 8, 2017
SharedResourcesBroker<GobblinScopeTypes> globalBroker = null;
try {
return runInternal(globalBroker);
}finally {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
}

private int runInternal(SharedResourcesBroker<GobblinScopeTypes> globalBroker)
Copy link
Contributor

@yukuai518 yukuai518 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put docs for the return param?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

if (workUnit instanceof MultiWorkUnit) {
// Flatten the MultiWorkUnit so the job configuration properties can be added to each individual WorkUnits
List<WorkUnit> flattenedWorkUnits = JobLauncherUtils.flattenWorkUnits(((MultiWorkUnit) workUnit).getWorkUnits());
workUnits.addAll(flattenedWorkUnits);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to simplify this? Maybe return flattenedWorkunits directly in if condition? In else condition just return ImmutableList.of(workunit)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe,
I just moved the existing code. I would prefer not to make this change for this PR.

this.stateStores = stateStores;
}

public int run()
Copy link
Contributor

@yukuai518 yukuai518 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add java docs for the return type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

return workUnitSize;

}
private void closeGlobalBroker(SharedResourcesBroker<GobblinScopeTypes> globalBroker) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an empty line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

private List<WorkUnit> getWorkUnits()
throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a coding style that exceptions will be a new line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDE auto formatted it based on the style config Gobblin provides.

*/
@Alpha
public class GobblinHelixTask implements Task {

private static final Logger LOGGER = LoggerFactory.getLogger(GobblinHelixTask.class);
private static final Logger _logger = LoggerFactory.getLogger(GobblinHelixTask.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the underscore be removed for code consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above.

}
}
_logger.error("GobblinHelixTask failed due to " + t.getMessage(), t);
return new TaskResult(TaskResult.Status.FAILED, Throwables.getStackTraceAsString(t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the state is changed to FAILED? ERROR means helix may retry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR has been deprecated and replaced with FAILED.
see the Helix doc for details.

*/
@Alpha
public class GobblinHelixTask implements Task {

private static final Logger LOGGER = LoggerFactory.getLogger(GobblinHelixTask.class);
private static final Logger _logger = LoggerFactory.getLogger(GobblinHelixTask.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change here? We usually avoid mixing '_' and this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing code doesn't use this consistently anyway.
This change is made to make logger usage more consistent and fit the google coding style and Linkedin coding style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced all the fields with _ prefix and removed all usages of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a consistent usage of this.logger elsewhere if the convention is not to mix _ with this. Did I miss something?

Also inlined a method. The old code has a bug: the globalBroker
variable will stay null.

Changed the implementation to use try with statement.
@yukuai518
Copy link
Contributor

+1 LGTM

Copy link
Contributor

@htran1 htran1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@HappyRay
Copy link
Contributor Author

HappyRay commented Dec 9, 2017

Opened an issue to track the flaky test.
https://issues.apache.org/jira/browse/GOBBLIN-340

@HappyRay
Copy link
Contributor Author

HappyRay commented Dec 9, 2017

@abti @htran1 could you merge?

@asfgit asfgit closed this in 0eeccde Dec 10, 2017
@HappyRay HappyRay deleted the encapsulate-non-helix-job-launch-logic branch December 11, 2017 15:52
autumnust pushed a commit to autumnust/gobblin that referenced this pull request Jan 9, 2018
task execution logic

Put the logic in its own class.

Also changed:
* Use a try-with statement to close the global
broker.
* Fix a Helix warning: ERROR is replaced with
FAILED.

Testing:

The integration test
org.apache.gobblin.cluster.ClusterIntegrationTest
passed.

Also inlined a method. The old code has a bug: the
globalBroker
variable will stay null.

Closes apache#2193 from HappyRay/encapsulate-non-helix-
job-launch-logic
autumnust pushed a commit to autumnust/gobblin that referenced this pull request Jan 9, 2018
task execution logic

Put the logic in its own class.

Also changed:
* Use a try-with statement to close the global
broker.
* Fix a Helix warning: ERROR is replaced with
FAILED.

Testing:

The integration test
org.apache.gobblin.cluster.ClusterIntegrationTest
passed.

Also inlined a method. The old code has a bug: the
globalBroker
variable will stay null.

Closes apache#2193 from HappyRay/encapsulate-non-helix-
job-launch-logic
@arpang
Copy link

arpang commented Jul 20, 2018

@HappyRay How were you able to resolve the following failure:

Incompatible changes:

Resource for "/home/travis/build/apache/incubator-gobblin/gobblin-rest-service/gobblin-rest-api/src/main/snapshot/org.apache.gobblin.rest.jobExecutions.snapshot.json" is not found. This endpoint will not be released. Please remove this file and build again
Resource for "/home/travis/build/apache/incubator-gobblin/gobblin-rest-service/gobblin-rest-api/src/main/idl/org.apache.gobblin.rest.jobExecutions.restspec.json" is not found. This endpoint will not be released. Please remove this file and build again```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants