Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

don't leak memory on first incremental build error #2418

Closed
wants to merge 1 commit into from
Closed

don't leak memory on first incremental build error #2418

wants to merge 1 commit into from

Conversation

kivikakk
Copy link

Hiya! This is kind of an aside to #1606 and #2280.

Presently, the esbuild server process leaks memory associated with the activeBuild and everything about it if a build({ incremental: true }) fails (rather than a rebuild from it), and there's no way for a user to recover from this.

There's probably a nicer solution that involves giving the rebuild back to the user in the thrown error, but as you've mentioned in #1606 (comment), the API gets a bit out of whack then and there's various things to ponder.

A minimally correct solution — at least, one that seems strictly more correct than what we have now, and that doesn't change the API whatsoever — is to rebuild-dispose before calling back with the failure.

@evanw evanw closed this in #2816 Jan 14, 2023
@kivikakk kivikakk deleted the incremental-first-error-leak branch January 16, 2023 22:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant