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 for #747 'git fetch' sporadically hangs, GitServiceExecutor now asynchronous. #840

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ijd02
Copy link

@ijd02 ijd02 commented Jul 4, 2019

Fixed git deadlock bug in GitServiceExecutor. Fault due to stdIn & stdOut buffers in the git.exe filling and blocking further processing. Handling in GitServiceExecutor now asynchronous i.e. Bonobo is continually emptying the buffers even while its sending data to git. Link to initial issue:
#747

@willdean
Copy link
Collaborator

willdean commented Jul 5, 2019

Thanks for this. There are a couple of issues I would like to discuss: (Note that I didn't write the original code, so I'm not defensive about it in the slightest!)

  • Is it necessary for both the input and the output stream to be async like this? If we start the output read before writing the input data, then the input write could probably stay synchronous, like it used to be?

  • If we're going to fix-up this broken routine, we should probably also make sure we're reading stderr at the same time as stdout, because otherwise is there still some kind of possible deadlock in the situation where a lot of stderr output occurs? (See the last sample on https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.standardoutput?view=netframework-4.8 )

  • I find myself a little uncomfortable about the mixture of an old-style pre-Task API (Process), modern Task-async and then the Thread.Sleep() and the Task.Wait() call. I wonder if it's better to avoid the CopyAsync and just use the old-style Process async methods, so avoid mixing approaches here? This is not a fully-thought-through position, just gut feel.

But thanks for the PR, anyway, I would definitely like to add this improvement once we're fully happy with it.

@ijd02
Copy link
Author

ijd02 commented Jul 9, 2019 via email

@willdean willdean mentioned this pull request Oct 11, 2019
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.

2 participants