Skip to content

fix: caching: resetting global static variable for each run, fixed ac…#238

Open
gethrok wants to merge 1 commit into
cesarParra:mainfrom
gethrok:fix/caching
Open

fix: caching: resetting global static variable for each run, fixed ac…#238
gethrok wants to merge 1 commit into
cesarParra:mainfrom
gethrok:fix/caching

Conversation

@gethrok
Copy link
Copy Markdown
Contributor

@gethrok gethrok commented May 18, 2026

Hello,

I think I have identified bug where enabling/disabling the cache was actually inverted... You have variable isStandardFunctionCacheDisabled = false;
and then you call
cacheFunctionCall(isStandardFunctionCacheDisabled, env, function, result);

But this method has Boolean shouldCache

private static void cacheFunctionCall(
        Boolean shouldCache,
        Environment env,
        Expr.FunctionCall function,
        Object result
    )

So if you call the method with isStandardFunctionCacheDisabled=false, it actually says shouldCache = false, therefore the caching is disabled. I would honestly rename it, I can see where this bug could come from :D Quickfix I inverted the boolean value on calling the method.

  1. Because the variable isStandardFunctionCacheDisabled is static, disabling or enabling the cache in the same transaction in single call will influence calling Evaluator in other places, therefore for each evaluate I am now explicitly enabling/disabling the caching.
    I was not sure if we should also reset the cache when it gets disabled or not, that I will leave open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant