[ https://issues.apache.org/jira/browse/HIVE-15168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15652357#comment-15652357 ]
Xuefu Zhang edited comment on HIVE-15168 at 11/9/16 11:22 PM: -------------------------------------------------------------- Could we have a few words describing the problem and the fix? It's not obvious while reading code diff. Thanks. Also, please attach the patch here as well. was (Author: xuefuz): Could we have a few words describing the problem and the fix? It's not obvious while reading code diff. Thanks. > Flaky test: TestSparkClient.testJobSubmission (still flaky) > ----------------------------------------------------------- > > Key: HIVE-15168 > URL: https://issues.apache.org/jira/browse/HIVE-15168 > Project: Hive > Issue Type: Sub-task > Reporter: Barna Zsombor Klara > Assignee: Barna Zsombor Klara > > [HIVE-14910|https://issues.apache.org/jira/browse/HIVE-14910] already > addressed one source of flakyness bud sadly not all it seems. > In JobHandleImpl the listeners are registered after the job has been > submitted. > This may end up in a racecondition. > {code} > // Link the RPC and the promise so that events from one are propagated to > the other as > // needed. > rpc.addListener(new > GenericFutureListener<io.netty.util.concurrent.Future<Void>>() { > @Override > public void operationComplete(io.netty.util.concurrent.Future<Void> > f) { > if (f.isSuccess()) { > handle.changeState(JobHandle.State.QUEUED); > } else if (!promise.isDone()) { > promise.setFailure(f.cause()); > } > } > }); > promise.addListener(new GenericFutureListener<Promise<T>>() { > @Override > public void operationComplete(Promise<T> p) { > if (jobId != null) { > jobs.remove(jobId); > } > if (p.isCancelled() && !rpc.isDone()) { > rpc.cancel(true); > } > } > }); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)