commit | 2ebd6cfee4b5bcd78cc9991cf7e74d15d369335c | [log] [tgz] |
---|---|---|
author | Suharsh Sivakumar <suharshs@google.com> | Tue Sep 22 16:37:31 2015 -0700 |
committer | Suharsh Sivakumar <suharshs@google.com> | Tue Sep 22 16:37:31 2015 -0700 |
tree | 2551aaa0762cb0793a9ec22b33d6d54eb7184a8a | |
parent | 03a16bea1adbf147397e6069596ed20c559061eb [diff] |
flow/conn: Don't kill proxied connections when approaching FD limits since they don't take up FD resources. Change-Id: Icb3894c3115690cdd9da4f11f24bfbf4be457451
diff --git a/runtime/internal/flow/conn/conn.go b/runtime/internal/flow/conn/conn.go index a7991c7..ecbd8a9 100644 --- a/runtime/internal/flow/conn/conn.go +++ b/runtime/internal/flow/conn/conn.go
@@ -346,3 +346,8 @@ c.lastUsedTime = time.Now() c.mu.Unlock() } + +func (c *Conn) IsEncapsulated() bool { + _, ok := c.mp.rw.(*flw) + return ok +}
diff --git a/runtime/internal/flow/manager/conncache.go b/runtime/internal/flow/manager/conncache.go index 92f8348..b3975e2 100644 --- a/runtime/internal/flow/manager/conncache.go +++ b/runtime/internal/flow/manager/conncache.go
@@ -151,6 +151,10 @@ delete(c.ridCache, e.rid) continue } + if e.conn.IsEncapsulated() { + // Killing a proxied connection doesn't save us any FD resources, just memory. + continue + } pq = append(pq, e) } sort.Sort(pq)