fix(ruleset): avoid async fetch limiter deadlock
This commit is contained in:
@@ -308,4 +308,4 @@ coalesce_retry_on_5xx=true
|
||||
;0 disables completed response caching. Values above 5 seconds are clamped to 5.
|
||||
response_cache_ttl=0
|
||||
;0 disables the limiter. A small value is safer on single-core deployments.
|
||||
max_async_fetches=2
|
||||
max_async_fetches=0
|
||||
|
||||
@@ -366,4 +366,4 @@ coalesce_retry_on_5xx = true
|
||||
# 0 disables completed response caching. If enabled, values above 5 seconds are clamped to 5.
|
||||
response_cache_ttl = 0
|
||||
# 0 disables the limiter. A small value is safer on single-core deployments.
|
||||
max_async_fetches = 2
|
||||
max_async_fetches = 0
|
||||
|
||||
@@ -175,4 +175,4 @@ advanced:
|
||||
enable_request_coalescing: true
|
||||
coalesce_retry_on_5xx: true
|
||||
response_cache_ttl: 0
|
||||
max_async_fetches: 2
|
||||
max_async_fetches: 0
|
||||
|
||||
@@ -129,8 +129,10 @@ std::shared_future<std::string> fetchFileAsync(const std::string &path, const st
|
||||
retVal = std::async(std::launch::async, [path](){return fileGet(path, true);});
|
||||
else if(isLink(path))
|
||||
{
|
||||
auto slot = acquireAsyncFetchSlot();
|
||||
retVal = std::async(std::launch::async, [path, proxy, cache_ttl, context, slot](){return webGet(path, proxy, cache_ttl, nullptr, nullptr, context);});
|
||||
retVal = std::async(std::launch::async, [path, proxy, cache_ttl, context](){
|
||||
auto slot = acquireAsyncFetchSlot();
|
||||
return webGet(path, proxy, cache_ttl, nullptr, nullptr, context);
|
||||
});
|
||||
}
|
||||
else
|
||||
return make_ready_future(std::string());
|
||||
|
||||
@@ -79,7 +79,7 @@ struct Settings {
|
||||
|
||||
// request coalescing and bounded background work
|
||||
bool enableRequestCoalescing = true, coalesceRetryOn5xx = true;
|
||||
int responseCacheTtl = 0, maxAsyncFetches = 2;
|
||||
int responseCacheTtl = 0, maxAsyncFetches = 0;
|
||||
unsigned long long configGeneration = 0;
|
||||
|
||||
// limits
|
||||
|
||||
Reference in New Issue
Block a user