diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2018-07-18 14:24:24 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2018-07-18 14:24:24 +0300 |
commit | 62cba10589d66853831a5e432c0a4619f84f574b (patch) | |
tree | 3777c1e1d62def8e62ae33df6382db993f22de17 | |
parent | 19e0c1f6406adcefe871282432ac655ba6526482 (diff) | |
parent | 1ffa4fb67874c893c25352b7774fc73599847a4b (diff) |
Merge branch 'gitaly-ruby-signals' into 'master'
Catch SIGINT in gitaly-ruby
See merge request gitlab-org/gitaly!818
-rw-r--r-- | changelogs/unreleased/gitaly-ruby-signals.yml | 5 | ||||
-rw-r--r-- | ruby/README.md | 10 | ||||
-rwxr-xr-x | ruby/bin/gitaly-ruby | 5 |
3 files changed, 19 insertions, 1 deletions
diff --git a/changelogs/unreleased/gitaly-ruby-signals.yml b/changelogs/unreleased/gitaly-ruby-signals.yml new file mode 100644 index 000000000..b45d78af6 --- /dev/null +++ b/changelogs/unreleased/gitaly-ruby-signals.yml @@ -0,0 +1,5 @@ +--- +title: Catch SIGINT in gitaly-ruby +merge_request: 818 +author: +type: other diff --git a/ruby/README.md b/ruby/README.md index 7a8dc3cfa..ce947a6b7 100644 --- a/ruby/README.md +++ b/ruby/README.md @@ -44,3 +44,13 @@ between gitlab-ce / gitlab-ee and `gitaly-ruby`. To update the vendored copy of Gitlab::Git, run `_support/vendor-gitlab-git COMMIT_ID` from the root of the Gitaly repository. + +## Development + +Gitaly-ruby is only meant to be spawned by Gitaly itself. But, during +development you may want to try spawning it in a terminal yourself. +You can do that with the following incantation: + +```shell +sh -c 'bin/gitaly-ruby $$ tmp/socket & wait' +``` diff --git a/ruby/bin/gitaly-ruby b/ruby/bin/gitaly-ruby index 7c16d2f0e..2b85af7fd 100755 --- a/ruby/bin/gitaly-ruby +++ b/ruby/bin/gitaly-ruby @@ -42,7 +42,10 @@ def main sleep end - trap('TERM') { signal_thread.kill } + %w[TERM INT].each do |signal| + trap(signal) { signal_thread.kill } + end + start_parent_watcher(ppid_i, signal_thread) run_thread = Thread.new do |