-
Notifications
You must be signed in to change notification settings - Fork 149
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
execTask.cancel()
doesn't kill the git process properly
#524
Comments
@maifeeulasad Love your enthusiasm to help! Just wanted to let you know that currently the team is pretty covered up, and cancelling a clone is not a high priority as it impacts a small number of users. Thus, we likely won't be able to give this much time, but of course feel free to continue exploring on your own. |
Dear, Today, I'll try to do a quick knowledge transfer session for this issue. This only contains the most recent and needed information. I'll share a more detailed version sometimes later on. And, I've tried adding all the necessary links as references at the very bottom. If I miss something, I'll mention them later. Now, let's get into business. IntroductionWhen we implemented the git operation cancelling functionality by introducing a new class But when I was trying to cancel a clone process, I couldn't. Upon further investigation, I found that the git clone operation is actually creating 5 different child processes.
So I tried exploring the first step, and all my work here revolves / evolves around the first approach. The IssueWhen I did more digging, I found that this issue only persists in Windows; in my Linux environment, it was working fine. The The SolutionAfter lots of digging, here is a native code that I could think of, to get our job done:
The ImplementationFinally, back in our codebase, after figuring out all these, I've made some major changes in the code:
Litmus Test:Now, I've introduced a new test, specifically for cloning. After canceling the clone operation, it will list the target directory (where we tried cloning), and if the cancel operation successfully completes, it should give us with an empty directory, along with returning a success code. The OutcomeYes, the operation is being canceled successfully, and as a result, the target directory is empty. I've checked from Task Manager and Process Explorer. The Issue with the SolutionAs we are putting Now I'm working on this "issue with the solution" part. Here is the PR link: https://github.com/desktop/dugite/pull/536/files. As this PR is already messed up with lots commits, instead of squashing commits, maybe I'll create a fresh PR when I'm all done Ref:
Intentionally setting it as a codeblock so that our notification inbox doesn't get spammed Surely it's a major modification, but I'm all in into this. Please let me know if you have any questions, doubts, or anything. And I thought it's better to share what I am doing / have done with you all. Good day. Keep me in your prayers. 🌻 |
Is there a way to kill git process by
I think if it is too difficult to kill a process,shell we just export the pid? |
Hello good people of Desktopland,
Hope you are all doing well. I was working on a task to cancel the cloning of a repository, but I was facing some issues.
So at eleventh hour (I thought about it earlier and forgot), I thought about creating a toy project, where I will simply try to clone something and cancel that task before it completes, and see what happens. So I think I have found some issue.
So let's take this piece of code for example:
This will return
0
fromcancel()
operation. But eventually the clone task will continue.Feel free to fire away any question.
Here is the toy project: https://github.com/maifeeulasad/dugite-exectask-playland. Right now this project is marked as private, but I have invited @tidy-dev and @sergiou87. Here is the invitation link: https://github.com/maifeeulasad/dugite-exectask-playland/invitations. If any collaborator thinks I should make it public, just let me know. And I'm avaiable to work on this problem. Really looking forward to contribute to GitHub Desktop.
The text was updated successfully, but these errors were encountered: