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

Clean FDs #735

Merged
merged 6 commits into from
Mar 30, 2023
Merged

Clean FDs #735

merged 6 commits into from
Mar 30, 2023

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.

@@ -125,6 +122,9 @@ void WAMRWasmModule::doBindToFunction(faabric::Message& msg, bool cache)

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.

None yet

1 participant