Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-workhorse
Commits
819a23d8
Commit
819a23d8
authored
Jan 15, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't need a sync.WaitGroup here
parent
59c95c75
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
internal/git/upload-pack.go
internal/git/upload-pack.go
+5
-11
No files found.
internal/git/upload-pack.go
View file @
819a23d8
...
...
@@ -6,7 +6,6 @@ import (
"io"
"io/ioutil"
"net/http"
"sync"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
...
...
@@ -51,23 +50,19 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
defer
helper
.
CleanUpProcessGroup
(
cmd
)
// Ensure brute force subprocess clean-up
stdoutError
:=
make
(
chan
error
,
1
)
var
wg
sync
.
WaitGroup
wg
.
Add
(
1
)
// Start writing the response
writePostRPCHeader
(
w
,
action
)
go
func
()
{
defer
wg
.
Done
()
if
_
,
err
:=
io
.
Copy
(
w
,
stdout
);
err
!=
nil
{
_
,
err
:=
io
.
Copy
(
w
,
stdout
)
if
err
!=
nil
{
helper
.
LogError
(
r
,
&
copyError
{
fmt
.
Errorf
(
"handleUploadPack: copy output of %v: %v"
,
cmd
.
Args
,
err
)},
)
stdoutError
<-
err
return
}
stdoutError
<-
err
}()
// Write the client request body to Git's standard input
...
...
@@ -78,10 +73,9 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
// Signal to the Git subprocess that no more data is coming
stdin
.
Close
()
wg
.
Wait
()
if
len
(
stdoutError
)
>
0
{
return
if
err
:=
<-
stdoutError
;
err
!=
nil
{
return
writtenIn
,
err
}
err
=
cmd
.
Wait
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment