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

Catch uncaught promise build abort race #8600

Merged
merged 1 commit into from
Nov 3, 2022
Merged

Catch uncaught promise build abort race #8600

merged 1 commit into from
Nov 3, 2022

Conversation

devongovett
Copy link
Member

@devongovett devongovett commented Nov 3, 2022

If a build is aborted while writing bundles, the process could crash. This happened because we didn't immediately await a promise, so if the build was aborted between when the promise was created and when it was awaited, node would trigger an unhandled promise rejection. This adds an empty .catch to prevent that. The error should still be picked up when the promise is awaited later.

Closes #8548

@parcel-benchmark
Copy link

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 2.09s -35.00ms
Cached 430.00ms -37.00ms 🚀

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 122.00ms -224.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 123.00ms -222.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 123.00ms -222.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 12.68s -616.00ms
Cached 551.00ms -47.00ms 🚀

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 2.29m -2.09s
Cached 2.83s +92.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Three.js ✅

Timings

Description Time Difference
Cold 8.79s -227.00ms
Cached 344.00ms -13.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 29b054c into v2 Nov 3, 2022
@devongovett devongovett deleted the uncaught-promise branch November 3, 2022 16:59
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.

BuildAbortError when making changes while watch mode is building
3 participants