Skip to content

Commit

Permalink
yamux: disable keep alive
Browse files Browse the repository at this point in the history
Disable yamux keep alive in channel and client.
yamux keep alive feature closes the connection with
proxy and agent when it's unable to ping them.

fixes kata-containers/proxy#70
fixes kata-containers#231

Signed-off-by: Julio Montes <julio.montes@intel.com>
  • Loading branch information
Julio Montes committed Jun 9, 2018
1 parent ac573e2 commit 570e716
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ func (c *serialChannel) wait() error {

func (c *serialChannel) listen() (net.Listener, error) {
// Initialize Yamux server.
session, err := yamux.Server(c.serialConn, nil)
config := yamux.DefaultConfig()
config.EnableKeepAlive = false
session, err := yamux.Server(c.serialConn, config)
if err != nil {
return nil, err
}
Expand Down
4 changes: 3 additions & 1 deletion protocols/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ func agentDialer(addr *url.URL, enableYamux bool) dialer {
}()

var session *yamux.Session
session, err = yamux.Client(conn, nil)
config := yamux.DefaultConfig()
config.EnableKeepAlive = false
session, err = yamux.Client(conn, config)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 570e716

Please sign in to comment.