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 build hang on Windows 10 #23589

Merged
merged 1 commit into from
Sep 1, 2021
Merged

Conversation

SeanMcMillan
Copy link
Contributor

On Windows 10, I seem to be unable to build. The build completion rises to 100%, but the process never finishes. I can build if I manually set the number of workers in the farm to 4, but not if it's any higher.

It appears that some files are not being counted as "complete". It's probably files that finish before the "ended" signal is received (meaning everything has been queued.) Moving the increment out of the conditional fixes this.

Description

Fix build hang on Windows 10

How has this been tested?

The build would hang on my Windows 10 machine, but succeed on my Mac. Making this change causes the build to succeed on my Windows 10 machine.

Types of changes

Bug Fix (Build tools)

Checklist:

  • [ Y ] My code is tested.
  • [ Y ] My code follows the WordPress code style.
  • [ NA ] My code follows the accessibility standards.
  • [ NA ] My code has proper inline documentation.
  • [ NA ] I've included developer documentation if appropriate.
  • [ NA ] I've updated all React Native files affected by any refactorings/renamings in this PR.

Base automatically changed from master to trunk March 1, 2021 15:43
@ramonjd ramonjd added [Type] Build Tooling Issues or PRs related to build tooling [Type] Bug An existing feature does not function as intended labels Aug 26, 2021
Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

This seems like a sensible change to take the increment operator out of the if condition.

I don't have a Windows machine, but npm run build:packages build still work for me.

I think we can merge this. cc @aduth @youknowriad who last edited this file just to double check.

@youknowriad
Copy link
Contributor

I'm not familiar particularly with that code but it seems to make sense, can we rebase maybe to get all the tests passing.

@SeanMcMillan
Copy link
Contributor Author

I tried to rebase this, but I can't get the build running at all due to #34377

I'll try again once that issue is cleared.

On Windows 10, I seem to be unable to build. The build completion rises
to 100%, but the process never finishes. I can build if I manually
set the number of workers in the farm to 4, but not if it's any higher.

It appears that some files are not being counted as "complete". It's
probably files that finish before the "ended" signal is recieved (meaning
everything has been queued.) Moving the increment out of the conditional
fixes this.
@SeanMcMillan
Copy link
Contributor Author

Rebased.

I can't always reproduce the hang without this change; It seems to be dependent on timing. I can never reproduce the hang with this change.

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

I can't reproduce the issue, but the problem and solution make sense. The workerFarm instance is meant to be ended when there's no more data to process and all files have completed, but complete would not be incremented as long as ended is false due to boolean short-circuiting. Not sure if that's a Windows thing, or just a CPU/IO race condition thing, which might explain why it only happens sometimes.

Alternatively, the order of the two conditions could be swapped ( ++complete === files.length && ended ) and I expect it would fix the issue as well, though it seems clearer to pull it out as you've proposed.

@youknowriad would you mind giving this a quick confidence check before merging? Since I've not been following the project closely, I'm not sure if there might be some potential conflict to consider here, though I don't expect it'd be an issue.

@youknowriad
Copy link
Contributor

Thanks for chiming in here @aduth :) this makes sense to me as well.

@youknowriad youknowriad merged commit c427574 into WordPress:trunk Sep 1, 2021
@github-actions
Copy link

github-actions bot commented Sep 1, 2021

Congratulations on your first merged pull request, @SeanMcMillan! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 11.5 milestone Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants