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

fix: Fix v8 error with graceful onClose cleanup #53

Merged
merged 2 commits into from
Jul 28, 2022

Conversation

gmaclennan
Copy link
Member

Seems like the cause of the v8 error we were getting (WiseLibs/better-sqlite3#842) might have been caused by terminating the worker threads without first closing the DB instance. This PR attempts to fix that by doing a graceful shutdown of workers (it waits for them to finish) before closing the server completely. This PR also adds the minThreads: 1 option to Piscina, since otherwise I think Piscina opens a worker thread for every CPU available on startup. This minimizes the initial overhead of thread creation.

@gmaclennan gmaclennan requested a review from achou11 July 28, 2022 14:53
Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

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

Smash that merge button!

@gmaclennan gmaclennan merged commit 91caaad into master Jul 28, 2022
@gmaclennan gmaclennan deleted the fix/v8-error-graceful-cleanup branch July 28, 2022 14:56
gmaclennan added a commit that referenced this pull request Jul 28, 2022
* master:
  fix: Fix v8 error with graceful onClose cleanup (#53)
  chore: simplify listStyles SQL (#52)
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

2 participants