KYLIN-2881 minor fix according to binmahone
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/61e4d3a7 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/61e4d3a7 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/61e4d3a7 Branch: refs/heads/KYLIN-2881-review Commit: 61e4d3a769b5e4a3b5dc1677e5622275bd0681b0 Parents: e1d8b71 Author: Zhong <nju_y...@apache.org> Authored: Mon Jan 15 09:54:47 2018 +0800 Committer: lidongsjtu <lid...@apache.org> Committed: Sun Jan 21 20:01:38 2018 +0800 ---------------------------------------------------------------------- .../src/main/java/org/apache/kylin/common/QueryContext.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/61e4d3a7/core-common/src/main/java/org/apache/kylin/common/QueryContext.java ---------------------------------------------------------------------- diff --git a/core-common/src/main/java/org/apache/kylin/common/QueryContext.java b/core-common/src/main/java/org/apache/kylin/common/QueryContext.java index 718f590..6703831 100644 --- a/core-common/src/main/java/org/apache/kylin/common/QueryContext.java +++ b/core-common/src/main/java/org/apache/kylin/common/QueryContext.java @@ -163,10 +163,9 @@ public class QueryContext { } private void stopQuery(Throwable t, String reason) { - if (isStopped()) { + if (!isRunning.compareAndSet(true, false)) { return; } - isRunning.set(false); this.throwable = t; this.stopReason = reason; for (QueryStopListener stopListener : stopListeners) {