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

Add initial implementation of cleanup logic when a Sandbox is evicted #8467

Merged
merged 1 commit into from Sep 12, 2023

Conversation

copybara-service[bot]
Copy link

Add initial implementation of cleanup logic when a Sandbox is evicted

Previously, when a Sandbox was evicted from SandboxManager, there was no logic
to shut down any of the associated resources. There was an implicit assumption
that the Sandbox would be garbage collected, and cleanup would magically occur,
but currently there are a lot of things preventing Sandbox GC from occurring,
and there are a lot of resources that need to be explicitly cleaned up.

Add a 'shutdown' method to Sandbox that closes the classloader and shuts down
the main executor thread. Although this is not currently sufficient to make the
Sandbox eligible for GC, it does free some resources.

Forthcoming CLs will add additional cleanup logic, with the eventual goal of
making Sandboxes eligible for GC when they are evicted from SandboxManager.

Previously, when a Sandbox was evicted from SandboxManager, there was no logic
to shut down any of the associated resources. There was an implicit assumption
that the Sandbox would be garbage collected, and cleanup would magically occur,
but currently there are a lot of things preventing Sandbox GC from occurring,
and there are a lot of resources that need to be explicitly cleaned up.

Add a 'shutdown' method to Sandbox that closes the classloader and shuts down
the main executor thread. Although this is not currently sufficient to make the
Sandbox eligible for GC, it does free some resources.

Forthcoming CLs will add additional cleanup logic, with the eventual goal of
making Sandboxes eligible for GC when they are evicted from SandboxManager.

PiperOrigin-RevId: 564790888
@copybara-service copybara-service bot merged commit c087df1 into google Sep 12, 2023
@copybara-service copybara-service bot deleted the piper_564463761 branch September 12, 2023 18:56
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