When using Instantiate
& InstantiateWithConfig
modules are removed implicitly from the in-memory cache
#2197
Labels
bug
Something isn't working
Describe the bug
When using
Instantiate
orInstantiateWithConfig
(implicit module compilation) - the flagcloseWithModule
on the compiled module is being raised. As a result of that - after module instantiation is complete - the compiled module is always being closed (hence removed from the in-memory cache!). Considering that caching is an important aspect - it makes complete sense for the flagcloseWithModule
to only be respected if no cache instance is configured on the level of the runtime instance.This behavior differs completely with what happens when a file system based cache is used. In this case, regardless of the
closeWithModule
flag, cached entries can be recovered (from disk) and re-compilation does not occur.To Reproduce
Try and execute one and the same command module using two compiler runtimes that share an in-memory cache (using either
Instantiate
orInstantiateWithConfig
). Observe that compilation occurs both times - before each module run.Expected behavior
After the first module run the In-memory cache shall in contain the compiled artifact so that the second run does not need to perform compliation.
Screenshots
N/A
Environment (please complete the relevant information):
1.22.1
v1.7.1
amd64
compiler
Additional context
Re-open of Issue #2191
The text was updated successfully, but these errors were encountered: