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

Suspend incomplete requests #9636

Open
wants to merge 8 commits into
base: v2
Choose a base branch
from
Open

Suspend incomplete requests #9636

wants to merge 8 commits into from

Conversation

benjervis
Copy link
Contributor

Some investigations during a previous PR (#9633) revealed that the long standing DevDepRequest error might be caused by a worker farm-related race condition.

As a possible fix for it, we've added a registry of incomplete requests where we suspend the processing of runRequest until the details have been returned from worker land.

It's currently locked behind a feature flag until we've done a bit more testing in the wild.

Copy link
Contributor

@marcins marcins left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me, especially behind an FF so we can validate if that's the cause of our issues.

Note though you have a Flow error that'll prevent merging.

for (let filePath of nullthrows(
devDepRequest.invalidateOnFileChange,
'DevDepRequest missing invalidateOnFileChange',
)) {
api.invalidateOnFileUpdate(filePath);
api.invalidateOnFileDelete(filePath);
}

for (let invalidation of nullthrows(
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably look at adding a lint rule to ensure nullthrows always has a description

Copy link
Contributor

Choose a reason for hiding this comment

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

Could just change the type definition. It'd be a bit of work though 😅

@@ -1029,6 +1031,10 @@ export default class RequestTracker {
options: ParcelOptions;
signal: ?AbortSignal;
stats: Map<RequestType, number> = new Map();
incompleteRequests: Map<
Copy link
Member

@devongovett devongovett Apr 13, 2024

Choose a reason for hiding this comment

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

We already have RequestGraph#incompleteNodeIds and also incompleteNodePromises. Could you use those here?

@bjornwah
Copy link

bjornwah commented May 28, 2024

Any progress on this? We're having a lot of "Unexpected undefined" which come from the nullthrows() stuff in runDevDepRequest. It is extra problematic if running stuff in parallel or running other heavy background tasks. That probably affects the timing of stuff?

About the nullthrows; the type 'DevDepRequest' is defined to have optional invalidateOnFileCreate/invalidateOnFileChange/invalidateOnStartup so I find it a bit odd that we even throw for that case.

That being said the issue is elsewhere - where this object is being constructed/populated. I'm struggling to follow where the code goes from here where the devDepRequests are constructed, but that thing sometimes returns incomplete devDepRequests.

@bjornwah
Copy link

bjornwah commented Nov 8, 2024

We have now abandoned parcel altogether because of this issue :'(

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.

6 participants