Skip to content

stree hangs out with 100% CPU #111

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

Closed
xfalcox opened this issue Jul 15, 2022 · 5 comments · Fixed by #112
Closed

stree hangs out with 100% CPU #111

xfalcox opened this issue Jul 15, 2022 · 5 comments · Fixed by #112

Comments

@xfalcox
Copy link

xfalcox commented Jul 15, 2022

Reproduction steps:

git clone https://github.com/discourse/discourse-chat.git
cd discourse-chat
bundle install
bundle exec stree check --plugins=plugin/single_quotes db/migrate/*.rb

We are evaluating adoption syntax_tree in discourse and wanted to start with this plugin so we can get CI and bugs ironed out.

It works fine on 2.7.1 but fails on 2.8.0 so I suspect it's the parallel code.

@kddnewton
Copy link
Member

Thanks! I'll take a look!

tbh I imagine it's not actually hanging but just taking a while. The issue is I removed the output that used to give progress feedback when I made everything parallel because it was hard to get it to sync properly without removing the benefit of the parallelization.

I'll take a look either way.

@kddnewton
Copy link
Member

Ahh no you're totally right something is borked with the parallel code.

@xfalcox
Copy link
Author

xfalcox commented Jul 15, 2022

Yeah, it runs very fast using 2.7.1 on the same machine :P

@kddnewton
Copy link
Member

Oh man... it was so dumb. I was using || on the booleans instead of | so it was just skipping some threads finishing. Ugh. Pushing a fix now.

@kddnewton
Copy link
Member

@xfalcox released in v3.0.1. Please let me know if there's anything else you run into or have questions about.

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 a pull request may close this issue.

2 participants