Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions driver/src/main/java/oracle/nosql/driver/http/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ public Result execute(Request kvRequest) {
break;
}

/* update iteration timeout in case limiters slept for some time */
thisTime = System.currentTimeMillis();
thisIterationTimeoutMs = timeoutMs - (int)(thisTime - startTime);

final String authString =
authProvider.getAuthorizationString(kvRequest);
authProvider.validateAuthString(authString);
Expand Down Expand Up @@ -566,6 +570,9 @@ public Result execute(Request kvRequest) {
*/
kvRequest.setCheckRequestSize(false);

/* update timeout in request to match this iteration timeout */
kvRequest.setTimeoutInternal(thisIterationTimeoutMs);

serialVersionUsed = writeContent(buffer, kvRequest);

/*
Expand Down
8 changes: 5 additions & 3 deletions driver/src/test/java/oracle/nosql/driver/QueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ public void testLowThroughput() {
if (onprem == false) {
assumeKVVersion("testLowThroughput", 21, 3, 1);
}
final int numRows = 500;
final int numRows = 30;
String name = "testThroughput";
String createTableDdl =
"CREATE TABLE " + name +
Expand All @@ -1719,7 +1719,7 @@ public void testLowThroughput() {
tableOperation(handle, createTableDdl, new TableLimits(2, 20000, 1));

MapValue value = new MapValue()
.put("bin", new byte[10000])
.put("bin", new byte[3000])
.put("json", "abc");
PutRequest putReq = new PutRequest().setTableName(name);

Expand All @@ -1732,7 +1732,9 @@ public void testLowThroughput() {
}

/*
* Ensure that this query completes
* Ensure that this query completes.
* 30 rows of 3K+ each = ~90KB.
* at 2RUs/sec, that's about 45 seconds.
*/
try (QueryRequest queryReq = newQueryRequest()) {
queryReq.setStatement("select * from " + name);
Expand Down