Skip to content

Commit

Permalink
Disable HTTP/2 for speaking to GCS.
Browse files Browse the repository at this point in the history
Due to golang/go#15930. Fixes #173.
  • Loading branch information
jacobsa committed Jun 2, 2016
2 parents 96816a1 + 996fb03 commit e391ae1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
14 changes: 14 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
package main

import (
"crypto/tls"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"os/signal"
"path"
Expand All @@ -46,6 +48,17 @@ import (
"github.com/kardianos/osext"
)

// httpTransport is a transport with HTTP/2 disabled. This is to work around
// very high memory usage for our read pattern (http://golang.org/issue/15930)
// and can be removed when we're building with a version of Go that has that
// issue fixed.
var httpTransport = func() *http.Transport {
t := &http.Transport{}
*t = *(http.DefaultTransport.(*http.Transport))
t.TLSNextProto = map[string]func(string, *tls.Conn) http.RoundTripper{}
return t
}()

////////////////////////////////////////////////////////////////////////
// Helpers
////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -205,6 +218,7 @@ func getConn(flags *flagStorage) (c gcs.Conn, err error) {
const userAgent = "gcsfuse/0.0"
cfg := &gcs.ConnConfig{
TokenSource: tokenSrc,
Transport: httpTransport,
UserAgent: userAgent,
}

Expand Down
11 changes: 10 additions & 1 deletion vendor/github.com/jacobsa/gcloud/gcs/conn.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 15 additions & 10 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,34 @@
"revisionTime": "2016-05-16T00:07:28Z"
},
{
"checksumSHA1": "v79niRn3bst9dPvawWXCi0BRYS8=",
"path": "github.com/jacobsa/gcloud/gcs",
"revision": "60dc0c7874d8adf958f7ded1e2edda4d7b3e8318",
"revisionTime": "2016-02-19T11:39:26+11:00"
"revision": "e9e54fcd1efc94e58b06aed435eca4b3f837da71",
"revisionTime": "2016-06-02T12:04:01Z"
},
{
"checksumSHA1": "NpZ4b33firshwopE9w/rzHFMIxg=",
"path": "github.com/jacobsa/gcloud/gcs/gcscaching",
"revision": "60dc0c7874d8adf958f7ded1e2edda4d7b3e8318",
"revisionTime": "2016-02-19T11:39:26+11:00"
"revision": "e9e54fcd1efc94e58b06aed435eca4b3f837da71",
"revisionTime": "2016-06-02T12:04:01Z"
},
{
"checksumSHA1": "4eF64wIG1vvwDIWOUr355L7zpMQ=",
"path": "github.com/jacobsa/gcloud/gcs/gcsfake",
"revision": "60dc0c7874d8adf958f7ded1e2edda4d7b3e8318",
"revisionTime": "2016-02-19T11:39:26+11:00"
"revision": "e9e54fcd1efc94e58b06aed435eca4b3f837da71",
"revisionTime": "2016-06-02T12:04:01Z"
},
{
"checksumSHA1": "1gvrpwRo8EnLnufGFGtzcyfUeIk=",
"path": "github.com/jacobsa/gcloud/gcs/gcsutil",
"revision": "60dc0c7874d8adf958f7ded1e2edda4d7b3e8318",
"revisionTime": "2016-02-19T11:39:26+11:00"
"revision": "e9e54fcd1efc94e58b06aed435eca4b3f837da71",
"revisionTime": "2016-06-02T12:04:01Z"
},
{
"checksumSHA1": "ub1Nzd6BdY10XoHOu3YVdS/6Tok=",
"path": "github.com/jacobsa/gcloud/httputil",
"revision": "60dc0c7874d8adf958f7ded1e2edda4d7b3e8318",
"revisionTime": "2016-02-19T11:39:26+11:00"
"revision": "e9e54fcd1efc94e58b06aed435eca4b3f837da71",
"revisionTime": "2016-06-02T12:04:01Z"
},
{
"path": "github.com/jacobsa/oglematchers",
Expand Down

0 comments on commit e391ae1

Please sign in to comment.