|
@@ -646,7 +646,11 @@ public class Netty4ChunkedContinuationsIT extends ESNetty4IntegTestCase {
|
|
|
client.execute(TYPE, new Request(), new RestActionListener<>(channel) {
|
|
|
@Override
|
|
|
protected void processResponse(Response response) {
|
|
|
- localRefs.mustIncRef();
|
|
|
+ // incRef can fail if the request was already cancelled
|
|
|
+ if (localRefs.tryIncRef() == false) {
|
|
|
+ assert localRefs.hasReferences() == false : "tryIncRef failed but RefCounted not completed";
|
|
|
+ return;
|
|
|
+ }
|
|
|
channel.sendResponse(RestResponse.chunked(RestStatus.OK, response.getResponseBodyPart(), () -> {
|
|
|
// cancellation notification only happens while processing a continuation, not while computing
|
|
|
// the next one; prompt cancellation requires use of something like RestCancellableNodeClient
|