Skip to content

Close Lua state before exiting redbean worker to allow GC to collect #941

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

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

pkulchenko
Copy link
Collaborator

@jart, this is a small patch to destroy the Lua state and allow Lua GC handlers to be called before workers exit. The only other way to get close to this is to call os.exit(true, true) from OnWorkerStop, but obviously it's not ideal, as it exits the process a bit too early not allowing redbean to finish its work.

Copy link
Owner

@jart jart left a comment

Choose a reason for hiding this comment

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

Thanks!

@jart jart merged commit 7138399 into jart:master Nov 11, 2023
G4Vi pushed a commit to G4Vi/cosmopolitan that referenced this pull request Jan 19, 2024
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