diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-11-01 17:33:25 +0100 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2019-01-21 15:09:25 +0100 |
commit | d0e23a4740c077690de8bcf8e2ca99e8049fb0be (patch) | |
tree | 34c9fc4556921e37088715064d0f61d1e7104735 /container-search | |
parent | 9ade75b7b8c79296370a85b65f6d0c8d7ff12a1b (diff) |
Change default timeout from 5000 to 500 ms
Diffstat (limited to 'container-search')
3 files changed, 9 insertions, 9 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 bf0920a2aa5..e1bfc96dab0 100644 --- a/container-search/src/main/java/com/yahoo/search/Query.java +++ b/container-search/src/main/java/com/yahoo/search/Query.java @@ -139,7 +139,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { // The timeout to be used when dumping rank features private static final long dumpTimeout = (6 * 60 * 1000); // 6 minutes - private static final long defaultTimeout = 5000; + private static final long defaultTimeout = 500; /** The timeout of the query, in milliseconds */ private long timeout = defaultTimeout; @@ -537,7 +537,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { /** * Returns the number of milliseconds to wait for a response from a search backend - * before timing it out. Default is 5000. + * before timing it out. Default is 500. * <p> * Note: If Ranking.RANKFEATURES is turned on, this is hardcoded to 6 minutes. * @@ -549,7 +549,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { /** * Sets the number of milliseconds to wait for a response from a search backend - * before time out. Default is 5000. + * before time out. Default is 500. */ public void setTimeout(long timeout) { if (timeout > 1000000000 || timeout < 0) @@ -885,7 +885,7 @@ public class Query extends com.yahoo.processing.Request implements Cloneable { yql.append(" limit ").append(Integer.toString(getHits())); } } - if (getTimeout() != 5000L) { + if (getTimeout() != defaultTimeout) { yql.append(" timeout ").append(Long.toString(getTimeout())); } yql.append(';'); diff --git a/container-search/src/test/java/com/yahoo/search/handler/test/SearchHandlerTestCase.java b/container-search/src/test/java/com/yahoo/search/handler/test/SearchHandlerTestCase.java index 5ef13eba2ed..7239ce961ce 100644 --- a/container-search/src/test/java/com/yahoo/search/handler/test/SearchHandlerTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/handler/test/SearchHandlerTestCase.java @@ -162,7 +162,7 @@ public class SearchHandlerTestCase { assertEquals("text/xml", s.getContentType()); assertNull(s.getCoverage()); assertEquals("query 'dummy'", s.getParsedQuery()); - assertEquals(5000, s.getTiming().getTimeout()); + assertEquals(500, s.getTiming().getTimeout()); } @Test diff --git a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java index f75b78fd36f..d92512c9989 100644 --- a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java +++ b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java @@ -100,7 +100,7 @@ public class VdsVisitorTestCase { private class QueryArguments { // General query parameters String query = "test"; - long timeout = 5; + double timeout = 0.5; int offset = 0; int hits = 10; int traceLevel = 0; @@ -155,7 +155,7 @@ public class VdsVisitorTestCase { private Query buildQuery(QueryArguments qa) throws Exception { StringBuilder queryString = new StringBuilder(); queryString.append("/?query=").append(qa.query); - if (qa.timeout != 5) { + if (qa.timeout != 0.5) { queryString.append("&timeout=").append(qa.timeout); } if (qa.offset != 0) { @@ -276,8 +276,8 @@ public class VdsVisitorTestCase { } // Verify parameters based only on query - assertEquals(qa.timeout*1000, params.getTimeoutMs()); - assertEquals(qa.timeout*1000, params.getSessionTimeoutMs()); + assertEquals(qa.timeout*1000, params.getTimeoutMs(),0.0000001); + assertEquals(qa.timeout*1000, params.getSessionTimeoutMs(), 0.0000001); assertEquals("searchvisitor", params.getVisitorLibrary()); assertEquals(Integer.MAX_VALUE, params.getMaxPending()); assertEquals(qa.traceLevel, params.getTraceLevel()); |