[ 
https://issues.apache.org/jira/browse/HTTPCORE-486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16150280#comment-16150280
 ] 

ASF subversion and git services commented on HTTPCORE-486:
----------------------------------------------------------

Commit dc2e9285a33d0ad05b4447d8d20b0868f8cde367 in httpcomponents-core's branch 
refs/heads/master from [~silver9886]
[ https://git-wip-us.apache.org/repos/asf?p=httpcomponents-core.git;h=dc2e928 ]

HTTPCORE-486: setting time limit on processPending methods

setting time limit to avoid the SingleCoreIOReactor's time be exhausted
and then  block the remaining work to do.

Closes PR #50


> SingleCoreIOReactor.processPendingChannels and 
> processPendingConnectionRequests should setting time limit
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-486
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-486
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore NIO
>    Affects Versions: 5.0-alpha3
>            Reporter: silver9886
>
> in processPendingChannels method
>  while ((socketChannel = this.channelQueue.poll()) != null) {
> }
> do not have the time limit.If there are too many socketChannel  in the 
> channelQueue
> or there is channelQueue.add in the loop,the SingleCoreIOReactor time will be 
> exhausted
> .That's will block the remaining work to do.
> I suggest using the following code:
> for (int i = 0 ;i < 100000 && (socketChannel = this.channelQueue.poll()) != 
> null;++i) {
> }
> the processPendingConnectionRequests method is the same



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to