Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
1
Description
In this code, intermittently in testing I'll see it go down the exception path:
```new JsonPointer("/results/-", (JsonPointerCB1) value -> { |
if (!currentRequest.completed()) { |
this.currentRequest.succeed(this.currentResponse); |
}
|
byte[] data = new byte[value.readableBytes()]; |
value.readBytes(data);
|
value.release();
|
if (!currentResponse.isCompleted()) { |
if (currentResponse.rowRequestSize() != 0 && currentResponse.rows().getPending() == 0) { |
currentResponse.rows().onNext(data);
|
currentResponse.rowRequestCompleted();
|
} else { |
currentResponse.completeExceptionally(
|
new QueryStreamException(currentResponse.rowRequestSize() == 0 ? "No row requests" |
: "Current row responses are not consumed")); |
}
|
}
|
}),```
|
My initial thoughts are that this is happening:
a) telling the subscriber to the request that the request is done
b) here the subscriber should subscribe to the currentResponse.rows(), which presumably also requests some rows (backpressure)
c) however, if that hasn't happened by the currentResponse.rowRequestSize() check, the code will fail
e.g. think there's a race