Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using Instantiate & InstantiateWithConfig modules are removed implicitly from the in-memory cache #2197

Closed
martinlakov opened this issue Apr 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@martinlakov
Copy link

Describe the bug

When using Instantiate or InstantiateWithConfig (implicit module compilation) - the flag closeWithModule 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 flag closeWithModule 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 or InstantiateWithConfig). 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):

  • Go version: 1.22.1
  • wazero Version: v1.7.1
  • Host architecture: amd64
  • Runtime mode: compiler

Additional context

Re-open of Issue #2191

@martinlakov martinlakov added the bug Something isn't working label Apr 25, 2024
@mathetake mathetake closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants