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

Anithamahalakshmi updated HTTPCLIENT-2351:
------------------------------------------
          Component/s: HttpClient (classic)
    Affects Version/s: 4.4.1
          Description: 
# During the initialisation of ApacheAsyncClient, a single main thread is 
created - 
[https://github.com/xSke/CoreServer/blob/master/src/org/apache/http/impl/nio/client/CloseableHttpAsyncClientBase.java#L40.]
 # This IO reactor thread does two key jobs: 1) It internally instantiate IO 
dispatcher threads once They never stop either. They keep polling for new IO 
event) and 2) It then works as a daemon (which never stops) to process new 
events. It worth to notice that all events IO reactor thread is connection 
related event per 
https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java#L164
 # For http request which needs a new IO connection, IO reactor thread is 
invoked to create such IO connection asynchronously - 
[https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java#L427]
 Connection pending to be created in such asynchronous process is reported as 
{{pending}} connection in Apache connection status.
 # In such asynchronous process, connection to be created is added into 
{{requestQueue}} - 
[https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java#L251].
 {{requestQueue}} is later on polled by IO reactor thread as a daemon, and 
established channel should be handed off to IO dispatcher thread via following 
logic 
-[https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java#L276].
 It is interesting to notice that which IO dispatcher thread such new channel 
should be handed off to is based on round-robin per 
[https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java#L475.]
 
 # The IO dispatcher thread is expected to pull and process new IO event 
assigned to it by selector, and then process assigned new channel as well per 
[https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java#L222]

However if a certain IO dispatcher thread is blocked while some previous 
processing, it goes undetected and new requests+connection pair keep getting 
assigned to the blocked thread which is unable to process the request and 
release the connection back to the pool, eventually we exhaust the max 
connection possible from the pool and cause availability drop.

 

  was:
Create module httpclient5-compress to use Apache Commons Compress.

Allow users to benefit from the support of various algorithms supported through 
the API of Apache Commons Compress.

[Apache Commons Compress|https://commons.apache.org/proper/commons-compress/] 
1.14 will support Brotli when released.

HttpClient should be recoded to find codec implementaions based on a Java 
{{ServiceLoader}}. Then, {{httpclient5-compress}} can add to that registry if 
it is on the classpath, the user will not have to do anything extra.

           Issue Type: Improvement  (was: New Feature)
             Priority: Critical  (was: Major)
              Summary: Safeguard against blocked IOWorker thread  (was: 
Safeguard against blocked IOWorker Thread)

> Safeguard against blocked IOWorker thread
> -----------------------------------------
>
>                 Key: HTTPCLIENT-2351
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2351
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient (classic)
>    Affects Versions: 4.4.1
>            Reporter: Anithamahalakshmi
>            Assignee: Gary D. Gregory
>            Priority: Critical
>             Fix For: Future
>
>
> # During the initialisation of ApacheAsyncClient, a single main thread is 
> created - 
> [https://github.com/xSke/CoreServer/blob/master/src/org/apache/http/impl/nio/client/CloseableHttpAsyncClientBase.java#L40.]
>  # This IO reactor thread does two key jobs: 1) It internally instantiate IO 
> dispatcher threads once They never stop either. They keep polling for new IO 
> event) and 2) It then works as a daemon (which never stops) to process new 
> events. It worth to notice that all events IO reactor thread is connection 
> related event per 
> https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java#L164
>  # For http request which needs a new IO connection, IO reactor thread is 
> invoked to create such IO connection asynchronously - 
> [https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java#L427]
>  Connection pending to be created in such asynchronous process is reported as 
> {{pending}} connection in Apache connection status.
>  # In such asynchronous process, connection to be created is added into 
> {{requestQueue}} - 
> [https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java#L251].
>  {{requestQueue}} is later on polled by IO reactor thread as a daemon, and 
> established channel should be handed off to IO dispatcher thread via 
> following logic 
> -[https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java#L276].
>  It is interesting to notice that which IO dispatcher thread such new channel 
> should be handed off to is based on round-robin per 
> [https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java#L475.]
>  
>  # The IO dispatcher thread is expected to pull and process new IO event 
> assigned to it by selector, and then process assigned new channel as well per 
> [https://github.com/wso2/wso2-httpcore-nio/blob/master/modules/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractIOReactor.java#L222]
> However if a certain IO dispatcher thread is blocked while some previous 
> processing, it goes undetected and new requests+connection pair keep getting 
> assigned to the blocked thread which is unable to process the request and 
> release the connection back to the pool, eventually we exhaust the max 
> connection possible from the pool and cause availability drop.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to