Skip to content

Conversation

@csegarragonz
Copy link
Collaborator

@csegarragonz csegarragonz commented Mar 30, 2023

When we prepare a filesystem (once per WasmModule lifecycle), we pre-open the required file descriptors, and keep adding new ones as WASM code opens files.

When reset-ing the module, we need to bring the filesystem back to the original state, as otherwise execution will fail. This includes clearing the existing filedescriptor map.

I add a regression test that catches this for WAMR (this was not an issue for WAVM, I think because during reset we move back to the original cached module).

I was thinking of adding the regression test in the test_file_descriptor.cpp file, but then I decided against it. However, in the process I added a test fixture for that file.


void WAMRWasmModule::bindInternal(faabric::Message& msg)
{
// Prepare the filesystem
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For WAMR we need to make sure that this gets callled on every reset.

@csegarragonz csegarragonz merged commit 4446354 into main Mar 30, 2023
@csegarragonz csegarragonz deleted the clean-fds branch March 30, 2023 15:58
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.

2 participants