Skip to content

Commit

Permalink
Script: Disable compilation rate limit in general cache for tests (el…
Browse files Browse the repository at this point in the history
…astic#79862) (elastic#79865)

`script.disable_max_compilations_rate` was not respected for the
general cache, only the context caches.

Fixes: elastic#79720
  • Loading branch information
stu-elastic authored Oct 26, 2021
1 parent 6261e7d commit cd94c34
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,12 @@ void setCacheHolder(Settings settings) {
}

CacheHolder generalCacheHolder(Settings settings) {
return new CacheHolder(SCRIPT_GENERAL_CACHE_SIZE_SETTING.get(settings), SCRIPT_GENERAL_CACHE_EXPIRE_SETTING.get(settings),
SCRIPT_GENERAL_MAX_COMPILATIONS_RATE_SETTING.get(settings), SCRIPT_GENERAL_MAX_COMPILATIONS_RATE_SETTING.getKey());
ScriptCache.CompilationRate rate = SCRIPT_GENERAL_MAX_COMPILATIONS_RATE_SETTING.get(settings);
if (SCRIPT_DISABLE_MAX_COMPILATIONS_RATE_SETTING.get(settings) || compilationLimitsEnabled() == false) {
rate = SCRIPT_COMPILATION_RATE_ZERO;
}
return new CacheHolder(SCRIPT_GENERAL_CACHE_SIZE_SETTING.get(settings), SCRIPT_GENERAL_CACHE_EXPIRE_SETTING.get(settings), rate,
SCRIPT_GENERAL_MAX_COMPILATIONS_RATE_SETTING.getKey());
}

CacheHolder contextCacheHolder(Settings settings) {
Expand Down

0 comments on commit cd94c34

Please sign in to comment.