| |   |
| 43 | 43 | end |
| 44 | 44 | |
| 45 | 45 | def run |
| 46 | | while session = @socket.accept |
| 47 | | connections = $children_active - $children_reaped |
| 48 | | if connections > MAX_CHILDREN |
| 49 | | log(Process.pid, "too many active children #{connections}/#{MAX_CHILDREN}") |
| 50 | | session.close |
| 51 | | next |
| 46 | begin |
| 47 | while session = @socket.accept |
| 48 | connections = $children_active - $children_reaped |
| 49 | if connections > MAX_CHILDREN |
| 50 | log(Process.pid, "too many active children #{connections}/#{MAX_CHILDREN}") |
| 51 | session.close |
| 52 | next |
| 53 | end |
| 54 | |
| 55 | run_service(session) |
| 52 | 56 | end |
| 53 | | |
| 54 | | run_service(session) |
| 57 | rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR |
| 58 | IO.select([@socket]) |
| 59 | retry |
| 55 | 60 | end |
| 56 | 61 | end |
| 57 | 62 | |
| toggle raw diff |
--- a/script/git-daemon
+++ b/script/git-daemon
@@ -43,15 +43,20 @@ module Git
end
def run
- while session = @socket.accept
- connections = $children_active - $children_reaped
- if connections > MAX_CHILDREN
- log(Process.pid, "too many active children #{connections}/#{MAX_CHILDREN}")
- session.close
- next
+ begin
+ while session = @socket.accept
+ connections = $children_active - $children_reaped
+ if connections > MAX_CHILDREN
+ log(Process.pid, "too many active children #{connections}/#{MAX_CHILDREN}")
+ session.close
+ next
+ end
+
+ run_service(session)
end
-
- run_service(session)
+ rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR
+ IO.select([@socket])
+ retry
end
end
|