[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-commons-dev
Subject:    [jira] [Resolved] (HTTPCLIENT-1944) Async request aborts working on HTTP/2, but not HTTP/1.1
From:       "Oleg Kalnichevski (JIRA)" <jira () apache ! org>
Date:       2018-08-31 12:54:00
Message-ID: JIRA.13179496.1534474804000.203456.1535720040255 () Atlassian ! JIRA
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1944?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Oleg Kalnichevski resolved HTTPCLIENT-1944.
-------------------------------------------
       Resolution: Fixed
    Fix Version/s: 5.0 Beta2

> Async request aborts working on HTTP/2, but not HTTP/1.1
> --------------------------------------------------------
> 
> Key: HTTPCLIENT-1944
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1944
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Affects Versions: 5.0 Beta1
> Reporter: Ryan Schmitt
> Priority: Major
> Fix For: 5.0 Beta2
> 
> 
> I have some test code that looks approximately like the following:
> {code:java}
> client = useHttp2 ? HttpAsyncClients.createHttp2Default() : \
> HttpAsyncClients.createDefault(); client.start();
> AsyncEntityProducer requestBody = ...; // A slow, endless stream of data
> AsyncRequestProducer post = AsyncRequestBuilder.create("POST")
> .setUri(endpoint)
> .setEntity(requestBody)
> .build();
> Future<SimpleHttpResponse> future = client.execute(post, \
> SimpleResponseConsumer.create(), new FutureCallback<SimpleHttpResponse>() { \
> @Override public void completed(SimpleHttpResponse result) {
> System.out.println("Request future completed");
> }
> @Override
> public void failed(Exception ex) {
> System.out.println("Request future failed");
> }
> @Override
> public void cancelled() {
> System.out.println("Request future cancelled");
> }
> });
> Thread.sleep(5_000);
> future.cancel(true);
> {code}
> What I'm observing is that request cancellation works immediately with the HTTP/2 \
> request, but doesn't work at all with the HTTP/1.1 request, which runs until it \
> times out. My own FutureCallback gets notified of the cancellation of the request, \
> but nothing else takes place within the client itself; the Cancellable associated \
> with the request at the time of cancellation is a NOOP_CANCELLABLE, whereas the \
> HTTP/2 request has a callback installed that aborts the underlying h2 stream.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic