diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-28 20:38:35 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-28 20:38:35 +0200 |
commit | 2a0a35a68edc3f604aa1747ffbbdefbd821c5470 (patch) | |
tree | a9c618276b5febbad477bffe68f942237c24abeb /container-search/src/main/java/com/yahoo | |
parent | a88fd8184a3b232d4c0f238e675f10a80724ca93 (diff) |
Restore old beahvior on clone.
- If getSessionId(true) has been called prior to clone, allcones will share sessionid with parent.
- If not, they will all get their own.
Diffstat (limited to 'container-search/src/main/java/com/yahoo')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/Query.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/Query.java b/container-search/src/main/java/com/yahoo/search/Query.java index 509a5f3d1de..23da30120da 100644 --- a/container-search/src/main/java/com/yahoo/search/Query.java +++ b/container-search/src/main/java/com/yahoo/search/Query.java @@ -153,7 +153,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { private QueryContext context = null; /** Used for downstream session caches */ - private final AtomicReference<UniqueRequestId> sessionId = new AtomicReference<>(); + private UniqueRequestId requestId = null; //--------------- Owned sub-objects containing query properties ---------------- @@ -962,18 +962,13 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { * @return the session id of this query, or null if not set and create is false */ public SessionId getSessionId(boolean create) { - UniqueRequestId uniqId = sessionId.get(); - if (uniqId == null && ! create) return null; + if (requestId == null && ! create) return null; - if (uniqId == null && create) { - uniqId = UniqueRequestId.next(); - sessionId.compareAndSet(null, uniqId); - uniqId = sessionId.get(); + if (requestId == null && create) { + requestId = UniqueRequestId.next(); } - String rankProfile = getRanking().getProfile(); - - return new SessionId(uniqId, rankProfile); + return new SessionId(requestId, getRanking().getProfile()); } public boolean hasEncodableProperties() { |