deis / builder

Git server and application builder for Deis Workflow
https://deis.com
MIT License
40 stars 41 forks source link

`git push` can't be interrupted #365

Closed mboersma closed 8 years ago

mboersma commented 8 years ago

Hitting Ctrl+C during a git push operation is expected to interrupt the builder and allow another git push to be started. See #339 and deis/workflow-e2e#207 for more description of the intended behavior.

But in practice it appears that the builder is not interrupted, and that it is only possible to git push again after the app release is deployed:

$ deis create
Creating Application... done, created native-waggoner
Git remote deis added
remote available at ssh://git@deis-builder.deis.rocks:2222/native-waggoner.git
$ git push deis master
Counting objects: 96, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (74/74), done.
Writing objects: 100% (96/96), 20.84 KiB | 0 bytes/s, done.
Total 96 (delta 40), reused 45 (delta 17)
Starting build... but first, coffee!
^CKilled by signal 2.

$ git push deis master
exec request failed on channel 0
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ git push deis master
exec request failed on channel 0
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ git push deis master
exec request failed on channel 0
fatal: remote error: Another git push is ongoing
$ git push deis master
exec request failed on channel 0
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ git push deis master
exec request failed on channel 0
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ git push deis master
Everything up-to-date
$ deis info
=== native-waggoner Application
updated:  2016-06-14T16:28:11Z
uuid:     695095d5-aa4d-46a0-bdc9-93a1c7c72c90
created:  2016-06-14T16:27:58Z
url:      native-waggoner.deis.rocks
owner:    matt
id:       native-waggoner

=== native-waggoner Processes
--- web:
native-waggoner-v2-web-zpefn up (v2)

=== native-waggoner Domains
native-waggoner
arschles commented 8 years ago

The fix for this issue should look for SSH channel closures and unlock the repo lock when the channel closes

mboersma commented 8 years ago

@vdice and I tested builder from when #339 was merged, and also v2.0.0 with #354 removed (on a hunch): same behavior as above.

So our current assumption is this didn't work quite as advertised in the first place, not that it has broken since then. Based on that, we're going to write the tests implied by deis/workflow-e2e#207 and fix the builder behavior to match.

mboersma commented 8 years ago

Having investigated further, I don't think it would be reasonable or consistent to implement this.

When I try the same Ctrl+C test during a git push to GitHub, the operation appears to complete atomically, just as Workflow does.

Looking at the receive-pack protocol description, I don't see any ping or out-of-band interrupt request type. Once the server is processing its receive-pack, there is no communication on the channel expected. The only way to detect a closed TCP socket is by trying to send data on it, but this would be a one-off protocol extension that would probably confuse a git client anyway.

shakisha commented 7 years ago

I have got the same identical issue; i've tried last 2.11 version and still the same.

bacongobbler commented 7 years ago

the latest version of workflow is v2.9.1. Can you check and confirm?

davilima6 commented 7 years ago

v2.9.0-eb21ef2 has this issue as well

bacongobbler commented 7 years ago

we have end-to-end tests that test this issue, and we did confirm it was fixed for v2.9.0: https://github.com/deis/workflow-e2e/blob/600a1d1221096547952f3bf6a56b18d51ca031e7/tests/git_push_test.go#L67-L76

Can you explain what exactly does not work for you?

sheerun commented 7 years ago

I experienced the same issue on v2.9.1 (fatal: remote error: Another git push is ongoing), probably after ctrl + c. I happens even after I destroy and re-create an app.

sheerun commented 7 years ago

I also have lots of issues with my internet connection, so maybe that's it

monaka commented 7 years ago

Similar to me. But looks caused by builder (pack-objects died by signal 13). On v2.9.1.

$ git push deis HEAD:master                                                                                                                                                                                       
Counting objects: 18286, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4913/4913), done.
Timeout, server deis-builder.{censored} not responding. 
fatal: The remote end hung up unexpectedly
error: pack-objects died of signal 13
error: failed to push some refs to 'ssh://git@{censored}:2222/helpy.git'
mboersma commented 7 years ago

@monaka this general issue "git push can't be interrupted" is still closed. If the problem you're describing is reproducible, could you open a new GitHub issue with more detail?

(Also note that there have been some fixes to builder since v2.9.1, and that v2.11 of Workflow should arrive today.)