You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2017/12/27 14:59:00 UTC

[jira] [Resolved] (HTTPCLIENT-1824) Async caching module is not async for cache I/O and does not share enough implementation with synchronous client cache

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

Oleg Kalnichevski resolved HTTPCLIENT-1824.
-------------------------------------------
    Resolution: Fixed

I completed a completely asynchronous caching interceptor for async HTTP/1.1 and HTTP/2 execution pipelines. While this should enable HttpClient 5.0 work fully asynchronously without blocking on cache operations when configured to use Memcached storage back-end this comes at substantial cost.

1. Asynchronous caching code is massively more complex (see AsyncCachingExec for a feel of it) because all processing logic needs to take place in callbacks. It is very difficult to keep track of what happens when. As a result it is likely to be quite buggy

2. Substantial chunks of code (~1'500 loc) had to be duplicated. I had to implement async versions of BasicHttpCache, BasicHttpAsyncCache and DefaultCacheInvalidator that do all the same but using callbacks. I considered using the async code for the classic execution pipeline that but that would require a complete rewrite of 50% of test cases and throwing a lot of stable, well tested code.

@[~jonm] If you could find some time to take a look it would be awesome.

Oleg 

> Async caching module is not async for cache I/O and does not share enough implementation with synchronous client cache
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1824
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1824
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>            Reporter: Jon Moore
>              Labels: cache
>             Fix For: 5.0
>
>
> As noted in HTTPASYNC-44, the caching module for the asynchronous client may do synchronous I/O when talking to cache storage; this isn't entirely clean and may violate client assumptions. In addition, there may need to be some refactoring of the synchronous client caching module so that more of the logic can be shared with the asynchronous stack.



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

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