This repository was archived by the owner on Sep 9, 2020. It is now read-only.
gps: return error if 'git fsck' checks are enabled and repo is corrupt#1981
Merged
kevinburke merged 1 commit intogolang:masterfrom Jan 24, 2019
Merged
gps: return error if 'git fsck' checks are enabled and repo is corrupt#1981kevinburke merged 1 commit intogolang:masterfrom
kevinburke merged 1 commit intogolang:masterfrom
Conversation
f7f2e19 to
f297939
Compare
f297939 to
219ba0e
Compare
Collaborator
Author
|
Just fixed the Travis CI build, whoops. |
219ba0e to
b2eafbf
Compare
b2eafbf to
5b21e2e
Compare
5b21e2e to
de01070
Compare
Previously, if dep tried to clone a repository over ssh that contained
zero padded file modes, dep would fail to clone and then hang. You can
reproduce this failure with the following .gitconfig:
[url "git@github.com:"]
insteadOf = https://github.com/
[transfer]
fsckobjects = true
[fetch]
fsckobjects = true
[receive]
fsckobjects = true
and the following Gopkg.toml. (It is not my intention to single out
this project - I searched Github for Go projects with zero padded file
mode errors, and found this one.)
[[constraint]]
name = "github.com/remogatto/gospeccy"
branch = "master"
`dep ensure` hangs because the git clone operation spins up an `ssh`
process as a child process. `cmd.Process.Kill` kills the parent `git`
operation, but not the child `ssh` operation, so it's orphaned and we
don't return properly from the function. (It's unclear to me at this
point why the ssh operation did not return when it completed.)
By sending the negative Pgrp value to the Kill() function we can kill
the entire child process group, not just the "parent child." See
https://medium.com/@felixge/killing-a-child-process-and-all-of-its-children-in-go-54079af94773
for more information.
Updates golang#1257.
de01070 to
5494240
Compare
jmank88
approved these changes
Jan 24, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, if dep tried to clone a repository over ssh that contained
zero padded file modes, dep would fail to clone and then hang. You can
reproduce this failure with the following .gitconfig:
and the following Gopkg.toml. (It is not my intention to single out
this project - I searched Github for Go projects with zero padded file
mode errors, and found this one.)
dep ensurehangs because the git clone operation spins up ansshprocess as a child process.
cmd.Process.Killkills the parentgitoperation, but not the child
sshoperation, so it's orphaned and wedon't return properly from the function. (It's unclear to me at this
point why the ssh operation did not return when it completed.)
By sending the negative Pgrp value to the Kill() function we can kill
the entire child process group, not just the "parent child." See
https://medium.com/@felixge/killing-a-child-process-and-all-of-its-children-in-go-54079af94773
for more information.
Updates #1257.