-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
base: v2
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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< |
There was a problem hiding this comment.
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?
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 |
We have now abandoned parcel altogether because of this issue :'( |
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.