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 hang if build does not start #272

Merged
merged 5 commits into from
May 13, 2024
Merged

Fix hang if build does not start #272

merged 5 commits into from
May 13, 2024

Conversation

slang25
Copy link
Contributor

@slang25 slang25 commented May 7, 2024

Fixes #271

There are other solutions to this, like running ReadAll in a Thread or Task and aborting that. I've also looked at the cancellation token and using that, however it's not being used effectively in ReadAll and I don't think there is simple solution as AnonymousPipeLoggerServer doesn't support cooperative cancellation as far as I can see.

There may be a memory leak here with the the two events being subscribed to, not sure if we want to try and engineer a better solution.

@@ -170,8 +172,22 @@ public IAnalyzerResults Build(string[] targetFrameworks, BuildEnvironment buildE
GetEffectiveEnvironmentVariables(buildEnvironment),
Manager.LoggerFactory))
{
processRunner.Exited += () =>
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if there is a convention specified for this, but I prefer a method being assigned here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed these event handlers to local functions 👍

@phmonte
Copy link
Owner

phmonte commented May 8, 2024

Thanks for the contribution @slang25 .

@phmonte phmonte merged commit 65950f7 into phmonte:main May 13, 2024
5 checks passed
@slang25 slang25 deleted the fix-hang branch May 13, 2024 22:37
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.

Buildalyzer hangs if build does not start
3 participants