Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2019-05-02 02:07:11 +0300
committerJohn Cai <jcai@gitlab.com>2019-05-02 02:07:11 +0300
commit3271b44336e8cb5e98d1d5919dfdeec1b5eeb778 (patch)
treed68a93e561875b7037d416b52a6e13fefb1da9a8
parentbe3c1e0908742d6c1150370e4c236446381d0683 (diff)
Revert "Merge branch 'jc-add-catfile-cache' into 'master'"jc-without-catfilejc-temp-2
This reverts commit 31248fb723a2b7a150eae552d14d9a68d10305b2, reversing changes made to b6d99f479da84bc4814ffaf573f28e95d7e5d488.
-rw-r--r--NOTICE193
-rw-r--r--internal/featureflag/grpc_header.go (renamed from internal/metadata/featureflag/grpc_header.go)0
-rw-r--r--internal/featureflag/grpc_header_test.go (renamed from internal/metadata/featureflag/grpc_header_test.go)0
-rw-r--r--internal/git/catfile/batch.go4
-rw-r--r--internal/git/catfile/batch_cache.go177
-rw-r--r--internal/git/catfile/batch_cache_test.go35
-rw-r--r--internal/git/catfile/batchcheck.go1
-rw-r--r--internal/git/catfile/catfile.go117
-rw-r--r--internal/metadata/metadata.go18
-rw-r--r--internal/service/commit/find_commit.go6
-rw-r--r--internal/service/commit/find_commit_test.go55
-rw-r--r--internal/service/commit/find_commits.go1
-rw-r--r--internal/service/commit/testhelper_test.go4
-rw-r--r--internal/service/repository/gc_test.go2
-rw-r--r--internal/service/repository/repack.go2
-rw-r--r--internal/service/repository/repack_test.go2
-rw-r--r--internal/testhelper/testhelper.go8
-rw-r--r--vendor/github.com/golang/groupcache/LICENSE191
-rw-r--r--vendor/github.com/golang/groupcache/lru/lru.go133
-rw-r--r--vendor/vendor.json6
20 files changed, 17 insertions, 938 deletions
diff --git a/NOTICE b/NOTICE
index 6bd052db3..bb2f54e72 100644
--- a/NOTICE
+++ b/NOTICE
@@ -262,199 +262,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-LICENSE - gitlab.com/gitlab-org/gitaly/vendor/github.com/golang/groupcache
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that entity.
-For the purposes of this definition, "control" means (i) the power, direct or
-indirect, to cause the direction or management of such entity, whether by
-contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the Work and such
-Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable (except as stated in this section) patent license to make, have
-made, use, offer to sell, sell, import, and otherwise transfer the Work, where
-such license applies only to those patent claims licensable by such Contributor
-that are necessarily infringed by their Contribution(s) alone or by combination
-of their Contribution(s) with the Work to which such Contribution(s) was
-submitted. If You institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a
-Contribution incorporated within the Work constitutes direct or contributory
-patent infringement, then any patent licenses granted to You under this License
-for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof
-in any medium, with or without modifications, and in Source or Object form,
-provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and
-You must cause any modified files to carry prominent notices stating that You
-changed the files; and
-You must retain, in the Source form of any Derivative Works that You distribute,
-all copyright, patent, trademark, and attribution notices from the Source form
-of the Work, excluding those notices that do not pertain to any part of the
-Derivative Works; and
-If the Work includes a "NOTICE" text file as part of its distribution, then any
-Derivative Works that You distribute must include a readable copy of the
-attribution notices contained within such NOTICE file, excluding those notices
-that do not pertain to any part of the Derivative Works, in at least one of the
-following places: within a NOTICE text file distributed as part of the
-Derivative Works; within the Source form or documentation, if provided along
-with the Derivative Works; or, within a display generated by the Derivative
-Works, if and wherever such third-party notices normally appear. The contents of
-the NOTICE file are for informational purposes only and do not modify the
-License. You may add Your own attribution notices within Derivative Works that
-You distribute, alongside or as an addendum to the NOTICE text from the Work,
-provided that such additional attribution notices cannot be construed as
-modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted
-for inclusion in the Work by You to the Licensor shall be under the terms and
-conditions of this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify the terms of
-any separate license agreement you may have executed with Licensor regarding
-such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks,
-service marks, or product names of the Licensor, except as required for
-reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the
-Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
-including, without limitation, any warranties or conditions of TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
-solely responsible for determining the appropriateness of using or
-redistributing the Work and assume any risks associated with Your exercise of
-permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence),
-contract, or otherwise, unless required by applicable law (such as deliberate
-and grossly negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License or
-out of the use or inability to use the Work (including but not limited to
-damages for loss of goodwill, work stoppage, computer failure or malfunction, or
-any and all other commercial damages or losses), even if such Contributor has
-been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to
-offer, and charge a fee for, acceptance of support, warranty, indemnity, or
-other liability obligations and/or rights consistent with this License. However,
-in accepting such obligations, You may act only on Your own behalf and on Your
-sole responsibility, not on behalf of any other Contributor, and only if You
-agree to indemnify, defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason of your
-accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work
-
-To apply the Apache License to your work, attach the following boilerplate
-notice, with the fields enclosed by brackets "[]" replaced with your own
-identifying information. (Don't include the brackets!) The text should be
-enclosed in the appropriate comment syntax for the file format. We also
-recommend that a file or class name and description of purpose be included on
-the same "printed page" as the copyright notice for easier identification within
-third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LICENSE - gitlab.com/gitlab-org/gitaly/vendor/github.com/golang/protobuf
Copyright 2010 The Go Authors. All rights reserved.
diff --git a/internal/metadata/featureflag/grpc_header.go b/internal/featureflag/grpc_header.go
index e71f1cfe9..e71f1cfe9 100644
--- a/internal/metadata/featureflag/grpc_header.go
+++ b/internal/featureflag/grpc_header.go
diff --git a/internal/metadata/featureflag/grpc_header_test.go b/internal/featureflag/grpc_header_test.go
index 8d18c6037..8d18c6037 100644
--- a/internal/metadata/featureflag/grpc_header_test.go
+++ b/internal/featureflag/grpc_header_test.go
diff --git a/internal/git/catfile/batch.go b/internal/git/catfile/batch.go
index ef39da7bc..ff7957819 100644
--- a/internal/git/catfile/batch.go
+++ b/internal/git/catfile/batch.go
@@ -36,9 +36,6 @@ func newBatch(ctx context.Context, repoPath string, env []string) (*batch, error
var stdinReader io.Reader
stdinReader, b.w = io.Pipe()
batchCmdArgs := []string{"--git-dir", repoPath, "cat-file", "--batch"}
-
- currentCatfileProcesses.Inc()
- totalCatfileProcesses.Inc()
batchCmd, err := git.BareCommand(ctx, stdinReader, nil, nil, env, batchCmdArgs...)
if err != nil {
return nil, err
@@ -48,7 +45,6 @@ func newBatch(ctx context.Context, repoPath string, env []string) (*batch, error
<-ctx.Done()
// This is crucial to prevent leaking file descriptors.
b.w.Close()
- currentCatfileProcesses.Dec()
}()
return b, nil
diff --git a/internal/git/catfile/batch_cache.go b/internal/git/catfile/batch_cache.go
deleted file mode 100644
index 8028cedd3..000000000
--- a/internal/git/catfile/batch_cache.go
+++ /dev/null
@@ -1,177 +0,0 @@
-package catfile
-
-import (
- "context"
- "strings"
- "sync"
- "time"
-
- "github.com/golang/groupcache/lru"
- "github.com/prometheus/client_golang/prometheus"
- "gitlab.com/gitlab-org/gitaly/internal/git/repository"
-)
-
-const (
- // CacheFeatureFlagKey is the feature flag key for catfile batch caching. This should match
- // what is in gitlab-ce
- CacheFeatureFlagKey = "catfile-cache"
- // CacheMaxItems is the default configuration for maximum entries in the batch cache
- CacheMaxItems = 100
-)
-
-var catfileCacheMembers = prometheus.NewGauge(
- prometheus.GaugeOpts{
- Name: "gitaly_catfile_cache_members",
- Help: "Gauge of catfile cache members",
- },
-)
-
-var cache *BatchCache
-
-func init() {
- prometheus.MustRegister(catfileCacheMembers)
- cache = NewCache(CacheMaxItems)
-}
-
-// CacheKey is a key for the catfile cache
-type CacheKey struct {
- sessionID string
- repoStorage string
- repoRelPath string
- repoObjDir string
- repoAltDir string
-}
-
-// CacheItem is a wrapper around Batch that provides a channel
-// through which the ttl goroutine can be stopped
-type CacheItem struct {
- batch *Batch
- stopTTL chan struct{}
- preserveBatchOnEvict bool
-}
-
-// ExpireAll is used to expire all of the batches in the cache
-func ExpireAll() {
- cache.Lock()
- defer cache.Unlock()
- cache.lru.Clear()
-}
-
-// BatchCache is a cache containing batch objects based on session id and repository path
-type BatchCache struct {
- sync.Mutex
- lru *lru.Cache
-}
-
-func closeBatchAndStopTTL(key lru.Key, value interface{}) {
- cacheItem := value.(CacheItem)
- close(cacheItem.stopTTL)
-
- if !cacheItem.preserveBatchOnEvict {
- cacheItem.batch.Close()
- }
-}
-
-// NewCache creates a new BatchCache
-func NewCache(maxEntries int) *BatchCache {
- lruCache := lru.New(maxEntries)
- lruCache.OnEvicted = closeBatchAndStopTTL
-
- return &BatchCache{
- lru: lruCache,
- }
-}
-
-// Get retrieves a batch based on a CacheKey. We remove it from the lru so that other processes can't Get it.
-// however, since OnEvicted is called every time something is evicted from the cache, we need to signal to the OnEvicted
-// function that we don't want this batch to be closed. Therefore, we will update the cache entry with preserveBatchOnEvict set
-// to true.
-func (bc *BatchCache) Get(key CacheKey) *Batch {
- bc.Lock()
- defer bc.Unlock()
-
- catfileCacheMembers.Set(float64(bc.lru.Len()))
-
- v, ok := bc.lru.Get(key)
- if !ok {
- return nil
- }
-
- cacheItem := v.(CacheItem)
-
- // set preserveBatchOnEvict=true so that OnEvict doesn't close the batch
- cacheItem.preserveBatchOnEvict = true
- bc.lru.Add(key, cacheItem)
-
- bc.lru.Remove(key)
-
- return cacheItem.batch
-}
-
-// Add Adds a batch based on a CacheKey. If there is already a batch for the given
-// key, it will remove and close the existing one, and Add the new one.
-func (bc *BatchCache) Add(key CacheKey, b *Batch, ttl time.Duration) {
- bc.Lock()
- defer bc.Unlock()
-
- if v, ok := bc.lru.Get(key); ok {
- existing := v.(*CacheItem)
- close(existing.stopTTL)
- existing.batch.Close()
- bc.lru.Remove(key)
- }
-
- stopTTL := make(chan struct{})
-
- bc.lru.Add(key, CacheItem{
- batch: b,
- stopTTL: stopTTL,
- })
-
- go func() {
- timer := time.NewTimer(ttl)
-
- select {
- case <-timer.C:
- bc.Del(key)
- // stopTTL channel is closed when the item is taken out of the cache so we don't have leaked goroutines
- case <-stopTTL:
- timer.Stop()
- }
- }()
-}
-
-// Del Deletes a batch based on a CacheKey
-func (bc *BatchCache) Del(key CacheKey) {
- bc.Lock()
- defer bc.Unlock()
-
- bc.lru.Remove(key)
-}
-
-// returnToCache returns the batch to the cache
-func (bc *BatchCache) returnToCache(ctx context.Context, cacheKey CacheKey, b *Batch) {
- <-ctx.Done()
-
- if b == nil || b.isClosed() {
- return
- }
-
- if b.HasUnreadData() {
- b.Close()
- return
- }
- bc.Add(cacheKey, b, DefaultBatchfileTTL)
-
-}
-
-// NewCacheKey return a cache key based on a session id and a git repository
-func NewCacheKey(sessionID string, repo repository.GitRepo) CacheKey {
- return CacheKey{
- sessionID: sessionID,
- repoStorage: repo.GetStorageName(),
- repoRelPath: repo.GetRelativePath(),
- repoObjDir: repo.GetGitObjectDirectory(),
- repoAltDir: strings.Join(repo.GetGitAlternateObjectDirectories(), ","),
- }
-}
diff --git a/internal/git/catfile/batch_cache_test.go b/internal/git/catfile/batch_cache_test.go
deleted file mode 100644
index 2b6353ea4..000000000
--- a/internal/git/catfile/batch_cache_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package catfile_test
-
-import (
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
- "gitlab.com/gitlab-org/gitaly/internal/git/catfile"
- "gitlab.com/gitlab-org/gitaly/internal/testhelper"
-)
-
-func TestBatchCacheTTL(t *testing.T) {
- ctx, cancel := testhelper.Context()
- defer cancel()
-
- testRepo, _, cleanupFn := testhelper.NewTestRepo(t)
- defer cleanupFn()
-
- batchCache := catfile.NewCache(10)
-
- c, err := catfile.New(ctx, testRepo)
- require.NoError(t, err)
-
- sessionID := "abcdefg1231231"
-
- ttl := 5 * time.Millisecond
-
- cacheKey := catfile.NewCacheKey(sessionID, testRepo)
- batchCache.Add(cacheKey, c, ttl)
-
- <-time.After(10 * time.Millisecond)
-
- assert.Nil(t, batchCache.Get(cacheKey))
-}
diff --git a/internal/git/catfile/batchcheck.go b/internal/git/catfile/batchcheck.go
index 77f49a05b..476ed457d 100644
--- a/internal/git/catfile/batchcheck.go
+++ b/internal/git/catfile/batchcheck.go
@@ -27,7 +27,6 @@ func newBatchCheck(ctx context.Context, repoPath string, env []string) (*batchCh
if err != nil {
return nil, err
}
-
bc.r = bufio.NewReader(batchCmd)
go func() {
<-ctx.Done()
diff --git a/internal/git/catfile/catfile.go b/internal/git/catfile/catfile.go
index 0794b0421..75e5924ca 100644
--- a/internal/git/catfile/catfile.go
+++ b/internal/git/catfile/catfile.go
@@ -2,60 +2,20 @@ package catfile
import (
"context"
- "fmt"
"io"
- "sync"
- "time"
- "github.com/prometheus/client_golang/prometheus"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/git/alternates"
- "gitlab.com/gitlab-org/gitaly/internal/metadata"
- "gitlab.com/gitlab-org/gitaly/internal/metadata/featureflag"
)
-var catfileCacheHitOrMiss = prometheus.NewCounterVec(
- prometheus.CounterOpts{
- Name: "gitaly_catfile_cache_total",
- Help: "Counter of catfile cache hit/miss",
- },
- []string{"type"},
-)
-
-var currentCatfileProcesses = prometheus.NewGauge(
- prometheus.GaugeOpts{
- Name: "gitaly_catfile_processes",
- Help: "Gauge of active catfile processes",
- },
-)
-
-var totalCatfileProcesses = prometheus.NewCounter(
- prometheus.CounterOpts{
- Name: "gitaly_catfile_processes_total",
- Help: "Counter of catfile processes",
- },
-)
-
-// DefaultBatchfileTTL is the default ttl for batch files to live in the cache
-var DefaultBatchfileTTL = 10 * time.Second
-
-func init() {
- prometheus.MustRegister(catfileCacheHitOrMiss)
- prometheus.MustRegister(currentCatfileProcesses)
- prometheus.MustRegister(totalCatfileProcesses)
-}
-
// Batch abstracts 'git cat-file --batch' and 'git cat-file --batch-check'.
// It lets you retrieve object metadata and raw objects from a Git repo.
//
// A Batch instance can only serve single request at a time. If you want to
// use it across multiple goroutines you need to add your own locking.
type Batch struct {
- sync.Mutex
*batchCheck
*batch
- cancel func()
- closed bool
}
// Info returns an ObjectInfo if spec exists. If spec does not exist the
@@ -95,36 +55,6 @@ func (c *Batch) Tag(revspec string) (io.Reader, error) {
return c.batch.reader(revspec, "tag")
}
-// Close closes the writers for batchCheck and batch. This is only used for
-// cached Batches
-func (c *Batch) Close() {
- c.Lock()
- defer c.Unlock()
-
- if c.closed {
- return
- }
-
- c.closed = true
- if c.cancel != nil {
- // both c.batch and c.batchCheck have goroutines that listen on <ctx.Done()
- // when this is cancelled, it will cause those goroutines to close both writers
- c.cancel()
- }
-}
-
-func (c *Batch) isClosed() bool {
- c.Lock()
- defer c.Unlock()
- return c.closed
-}
-
-// HasUnreadData returns a boolean specifying whether or not the Batch has more
-// data still to be read
-func (c *Batch) HasUnreadData() bool {
- return c.n > 1
-}
-
// New returns a new Batch instance. It is important that ctx gets canceled
// somewhere, because if it doesn't the cat-file processes spawned by
// New() never terminate.
@@ -138,54 +68,17 @@ func New(ctx context.Context, repo *gitalypb.Repository) (*Batch, error) {
return nil, err
}
- sessionID := metadata.GetValue(ctx, "gitaly-session-id")
-
- if featureflag.IsDisabled(ctx, CacheFeatureFlagKey) || sessionID == "" {
- // if caching us used, the caller is responsible for putting the catfile
- // into the cache
- batch, err := newBatch(ctx, repoPath, env)
- if err != nil {
- return nil, err
- }
-
- batchCheck, err := newBatchCheck(ctx, repoPath, env)
- if err != nil {
- return nil, err
- }
-
- return &Batch{batch: batch, batchCheck: batchCheck}, nil
- }
-
- cacheKey := NewCacheKey(sessionID, repo)
+ c := &Batch{}
- c := cache.Get(cacheKey)
-
- defer func() {
- go cache.returnToCache(ctx, cacheKey, c)
- }()
-
- if c != nil {
- catfileCacheHitOrMiss.WithLabelValues("hit").Inc()
- cache.Del(cacheKey)
- return c, nil
- }
-
- catfileCacheHitOrMiss.WithLabelValues("miss").Inc()
- // if we are using caching, create a fresh context for the new batch
- // and initialize the new batch with a cache key and cancel function
- cacheCtx, cacheCancel := context.WithCancel(context.Background())
- c = &Batch{cancel: cacheCancel}
-
- c.batch, err = newBatch(cacheCtx, repoPath, env)
+ c.batch, err = newBatch(ctx, repoPath, env)
if err != nil {
- return nil, fmt.Errorf("error when creating new batch: %v", err)
+ return nil, err
}
- c.batchCheck, err = newBatchCheck(cacheCtx, repoPath, env)
+ c.batchCheck, err = newBatchCheck(ctx, repoPath, env)
if err != nil {
- return nil, fmt.Errorf("error when creating new batch check: %v", err)
+ return nil, err
}
return c, nil
-
}
diff --git a/internal/metadata/metadata.go b/internal/metadata/metadata.go
deleted file mode 100644
index e78ec0843..000000000
--- a/internal/metadata/metadata.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package metadata
-
-import (
- "context"
-
- "google.golang.org/grpc/metadata"
-)
-
-// GetValue returns the first value in the metadata slice based on a key
-func GetValue(ctx context.Context, key string) string {
- md, ok := metadata.FromIncomingContext(ctx)
- if ok {
- if values, ok := md[key]; ok && len(values) > 0 {
- return values[0]
- }
- }
- return ""
-}
diff --git a/internal/service/commit/find_commit.go b/internal/service/commit/find_commit.go
index dd67becda..902788055 100644
--- a/internal/service/commit/find_commit.go
+++ b/internal/service/commit/find_commit.go
@@ -3,17 +3,17 @@ package commit
import (
"context"
- "gitlab.com/gitlab-org/gitaly/internal/helper"
-
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/log"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
)
func (s *server) FindCommit(ctx context.Context, in *gitalypb.FindCommitRequest) (*gitalypb.FindCommitResponse, error) {
revision := in.GetRevision()
if err := git.ValidateRevision(revision); err != nil {
- return nil, helper.ErrInvalidArgument(err)
+ return nil, status.Errorf(codes.InvalidArgument, "FindCommit: revision: %v", err)
}
repo := in.GetRepository()
diff --git a/internal/service/commit/find_commit_test.go b/internal/service/commit/find_commit_test.go
index 73eba3d73..d5935beb5 100644
--- a/internal/service/commit/find_commit_test.go
+++ b/internal/service/commit/find_commit_test.go
@@ -1,7 +1,6 @@
package commit
import (
- "bufio"
"context"
"io/ioutil"
"strings"
@@ -10,14 +9,10 @@ import (
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
- "gitlab.com/gitlab-org/gitaly/internal/git"
- "gitlab.com/gitlab-org/gitaly/internal/git/catfile"
"gitlab.com/gitlab-org/gitaly/internal/git/log"
"gitlab.com/gitlab-org/gitaly/internal/helper"
- "gitlab.com/gitlab-org/gitaly/internal/metadata/featureflag"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"google.golang.org/grpc/codes"
- "google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
)
@@ -291,53 +286,3 @@ func TestFailedFindCommitRequest(t *testing.T) {
})
}
}
-
-func BenchmarkFindCommitNoCache(b *testing.B) {
- benchmarkFindCommit(false, b)
-}
-func BenchmarkFindCommitWithCache(b *testing.B) {
- benchmarkFindCommit(true, b)
-}
-
-func benchmarkFindCommit(withCache bool, b *testing.B) {
- ctx, cancel := testhelper.Context()
- defer cancel()
-
- server, serverSocketPath := startTestServices(b)
- defer server.Stop()
-
- client, conn := newCommitServiceClient(b, serverSocketPath)
- defer conn.Close()
-
- testRepo, _, cleanupFn := testhelper.NewTestRepo(b)
- defer cleanupFn()
-
- // get a list of revisions
-
- logCmd, err := git.Command(ctx, testRepo, "log", "--format=format:%H")
- require.NoError(b, err)
-
- logScanner := bufio.NewScanner(logCmd)
-
- var revisions []string
- for logScanner.Scan() {
- revisions = append(revisions, logScanner.Text())
- }
-
- require.NoError(b, logCmd.Wait())
-
- defer catfile.ExpireAll()
-
- for i := 0; i < b.N; i++ {
- revision := revisions[b.N%len(revisions)]
- if withCache {
- md := metadata.New(map[string]string{featureflag.HeaderKey(catfile.CacheFeatureFlagKey): "true", "gitaly-session-id": "abc123"})
- ctx = metadata.NewOutgoingContext(ctx, md)
- }
- _, err := client.FindCommit(ctx, &gitalypb.FindCommitRequest{
- Repository: testRepo,
- Revision: []byte(revision),
- })
- require.NoError(b, err)
- }
-}
diff --git a/internal/service/commit/find_commits.go b/internal/service/commit/find_commits.go
index 489f11240..8d4967873 100644
--- a/internal/service/commit/find_commits.go
+++ b/internal/service/commit/find_commits.go
@@ -51,7 +51,6 @@ func findCommits(ctx context.Context, req *gitalypb.FindCommitsRequest, stream g
if err != nil {
return fmt.Errorf("error when creating git log command: %v", err)
}
-
batch, err := catfile.New(ctx, req.GetRepository())
if err != nil {
return fmt.Errorf("creating catfile: %v", err)
diff --git a/internal/service/commit/testhelper_test.go b/internal/service/commit/testhelper_test.go
index 861b2e89c..caa3a29b9 100644
--- a/internal/service/commit/testhelper_test.go
+++ b/internal/service/commit/testhelper_test.go
@@ -40,7 +40,7 @@ func testMain(m *testing.M) int {
return m.Run()
}
-func startTestServices(t testing.TB) (*grpc.Server, string) {
+func startTestServices(t *testing.T) (*grpc.Server, string) {
server := testhelper.NewTestGrpcServer(t, nil, nil)
serverSocketPath := testhelper.GetTemporaryGitalySocketFileName()
@@ -56,7 +56,7 @@ func startTestServices(t testing.TB) (*grpc.Server, string) {
return server, "unix://" + serverSocketPath
}
-func newCommitServiceClient(t testing.TB, serviceSocketPath string) (gitalypb.CommitServiceClient, *grpc.ClientConn) {
+func newCommitServiceClient(t *testing.T, serviceSocketPath string) (gitalypb.CommitServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
}
diff --git a/internal/service/repository/gc_test.go b/internal/service/repository/gc_test.go
index 7bd0969af..35e429806 100644
--- a/internal/service/repository/gc_test.go
+++ b/internal/service/repository/gc_test.go
@@ -13,8 +13,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
+ "gitlab.com/gitlab-org/gitaly/internal/featureflag"
"gitlab.com/gitlab-org/gitaly/internal/helper/text"
- "gitlab.com/gitlab-org/gitaly/internal/metadata/featureflag"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
diff --git a/internal/service/repository/repack.go b/internal/service/repository/repack.go
index aeaf5fe4f..4d2d0dad7 100644
--- a/internal/service/repository/repack.go
+++ b/internal/service/repository/repack.go
@@ -6,9 +6,9 @@ import (
"github.com/prometheus/client_golang/prometheus"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
+ "gitlab.com/gitlab-org/gitaly/internal/featureflag"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/repository"
- "gitlab.com/gitlab-org/gitaly/internal/metadata/featureflag"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
diff --git a/internal/service/repository/repack_test.go b/internal/service/repository/repack_test.go
index 082d41243..324c61532 100644
--- a/internal/service/repository/repack_test.go
+++ b/internal/service/repository/repack_test.go
@@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
- "gitlab.com/gitlab-org/gitaly/internal/metadata/featureflag"
+ "gitlab.com/gitlab-org/gitaly/internal/featureflag"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go
index 5b139227f..71242fa0c 100644
--- a/internal/testhelper/testhelper.go
+++ b/internal/testhelper/testhelper.go
@@ -144,7 +144,7 @@ func RequireGrpcError(t *testing.T, err error, expectedCode codes.Code) {
}
// MustRunCommand runs a command with an optional standard input and returns the standard output, or fails.
-func MustRunCommand(t testing.TB, stdin io.Reader, name string, args ...string) []byte {
+func MustRunCommand(t *testing.T, stdin io.Reader, name string, args ...string) []byte {
cmd := exec.Command(name, args...)
if name == "git" {
@@ -352,7 +352,7 @@ func Context() (context.Context, func()) {
}
// CreateRepo creates an temporary directory for a repo, without initializing it
-func CreateRepo(t testing.TB, storagePath string) (repo *gitalypb.Repository, repoPath, relativePath string) {
+func CreateRepo(t *testing.T, storagePath string) (repo *gitalypb.Repository, repoPath, relativePath string) {
normalizedPrefix := strings.Replace(t.Name(), "/", "-", -1) //TempDir doesn't like a prefix containing slashes
repoPath, err := ioutil.TempDir(storagePath, normalizedPrefix)
@@ -392,7 +392,7 @@ func initRepo(t *testing.T, bare bool) (*gitalypb.Repository, string, func()) {
}
// NewTestRepo creates a bare copy of the test repository.
-func NewTestRepo(t testing.TB) (repo *gitalypb.Repository, repoPath string, cleanup func()) {
+func NewTestRepo(t *testing.T) (repo *gitalypb.Repository, repoPath string, cleanup func()) {
return cloneTestRepo(t, true)
}
@@ -402,7 +402,7 @@ func NewTestRepoWithWorktree(t *testing.T) (repo *gitalypb.Repository, repoPath
return cloneTestRepo(t, false)
}
-func cloneTestRepo(t testing.TB, bare bool) (repo *gitalypb.Repository, repoPath string, cleanup func()) {
+func cloneTestRepo(t *testing.T, bare bool) (repo *gitalypb.Repository, repoPath string, cleanup func()) {
storagePath := GitlabTestStoragePath()
repo, repoPath, relativePath := CreateRepo(t, storagePath)
testRepo := TestRepository()
diff --git a/vendor/github.com/golang/groupcache/LICENSE b/vendor/github.com/golang/groupcache/LICENSE
deleted file mode 100644
index 37ec93a14..000000000
--- a/vendor/github.com/golang/groupcache/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that entity.
-For the purposes of this definition, "control" means (i) the power, direct or
-indirect, to cause the direction or management of such entity, whether by
-contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the Work and such
-Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable (except as stated in this section) patent license to make, have
-made, use, offer to sell, sell, import, and otherwise transfer the Work, where
-such license applies only to those patent claims licensable by such Contributor
-that are necessarily infringed by their Contribution(s) alone or by combination
-of their Contribution(s) with the Work to which such Contribution(s) was
-submitted. If You institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a
-Contribution incorporated within the Work constitutes direct or contributory
-patent infringement, then any patent licenses granted to You under this License
-for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof
-in any medium, with or without modifications, and in Source or Object form,
-provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and
-You must cause any modified files to carry prominent notices stating that You
-changed the files; and
-You must retain, in the Source form of any Derivative Works that You distribute,
-all copyright, patent, trademark, and attribution notices from the Source form
-of the Work, excluding those notices that do not pertain to any part of the
-Derivative Works; and
-If the Work includes a "NOTICE" text file as part of its distribution, then any
-Derivative Works that You distribute must include a readable copy of the
-attribution notices contained within such NOTICE file, excluding those notices
-that do not pertain to any part of the Derivative Works, in at least one of the
-following places: within a NOTICE text file distributed as part of the
-Derivative Works; within the Source form or documentation, if provided along
-with the Derivative Works; or, within a display generated by the Derivative
-Works, if and wherever such third-party notices normally appear. The contents of
-the NOTICE file are for informational purposes only and do not modify the
-License. You may add Your own attribution notices within Derivative Works that
-You distribute, alongside or as an addendum to the NOTICE text from the Work,
-provided that such additional attribution notices cannot be construed as
-modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted
-for inclusion in the Work by You to the Licensor shall be under the terms and
-conditions of this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify the terms of
-any separate license agreement you may have executed with Licensor regarding
-such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks,
-service marks, or product names of the Licensor, except as required for
-reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the
-Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
-including, without limitation, any warranties or conditions of TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
-solely responsible for determining the appropriateness of using or
-redistributing the Work and assume any risks associated with Your exercise of
-permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence),
-contract, or otherwise, unless required by applicable law (such as deliberate
-and grossly negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License or
-out of the use or inability to use the Work (including but not limited to
-damages for loss of goodwill, work stoppage, computer failure or malfunction, or
-any and all other commercial damages or losses), even if such Contributor has
-been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to
-offer, and charge a fee for, acceptance of support, warranty, indemnity, or
-other liability obligations and/or rights consistent with this License. However,
-in accepting such obligations, You may act only on Your own behalf and on Your
-sole responsibility, not on behalf of any other Contributor, and only if You
-agree to indemnify, defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason of your
-accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work
-
-To apply the Apache License to your work, attach the following boilerplate
-notice, with the fields enclosed by brackets "[]" replaced with your own
-identifying information. (Don't include the brackets!) The text should be
-enclosed in the appropriate comment syntax for the file format. We also
-recommend that a file or class name and description of purpose be included on
-the same "printed page" as the copyright notice for easier identification within
-third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/github.com/golang/groupcache/lru/lru.go b/vendor/github.com/golang/groupcache/lru/lru.go
deleted file mode 100644
index eac1c7664..000000000
--- a/vendor/github.com/golang/groupcache/lru/lru.go
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-Copyright 2013 Google Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Package lru implements an LRU cache.
-package lru
-
-import "container/list"
-
-// Cache is an LRU cache. It is not safe for concurrent access.
-type Cache struct {
- // MaxEntries is the maximum number of cache entries before
- // an item is evicted. Zero means no limit.
- MaxEntries int
-
- // OnEvicted optionally specifies a callback function to be
- // executed when an entry is purged from the cache.
- OnEvicted func(key Key, value interface{})
-
- ll *list.List
- cache map[interface{}]*list.Element
-}
-
-// A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators
-type Key interface{}
-
-type entry struct {
- key Key
- value interface{}
-}
-
-// New creates a new Cache.
-// If maxEntries is zero, the cache has no limit and it's assumed
-// that eviction is done by the caller.
-func New(maxEntries int) *Cache {
- return &Cache{
- MaxEntries: maxEntries,
- ll: list.New(),
- cache: make(map[interface{}]*list.Element),
- }
-}
-
-// Add adds a value to the cache.
-func (c *Cache) Add(key Key, value interface{}) {
- if c.cache == nil {
- c.cache = make(map[interface{}]*list.Element)
- c.ll = list.New()
- }
- if ee, ok := c.cache[key]; ok {
- c.ll.MoveToFront(ee)
- ee.Value.(*entry).value = value
- return
- }
- ele := c.ll.PushFront(&entry{key, value})
- c.cache[key] = ele
- if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries {
- c.RemoveOldest()
- }
-}
-
-// Get looks up a key's value from the cache.
-func (c *Cache) Get(key Key) (value interface{}, ok bool) {
- if c.cache == nil {
- return
- }
- if ele, hit := c.cache[key]; hit {
- c.ll.MoveToFront(ele)
- return ele.Value.(*entry).value, true
- }
- return
-}
-
-// Remove removes the provided key from the cache.
-func (c *Cache) Remove(key Key) {
- if c.cache == nil {
- return
- }
- if ele, hit := c.cache[key]; hit {
- c.removeElement(ele)
- }
-}
-
-// RemoveOldest removes the oldest item from the cache.
-func (c *Cache) RemoveOldest() {
- if c.cache == nil {
- return
- }
- ele := c.ll.Back()
- if ele != nil {
- c.removeElement(ele)
- }
-}
-
-func (c *Cache) removeElement(e *list.Element) {
- c.ll.Remove(e)
- kv := e.Value.(*entry)
- delete(c.cache, kv.key)
- if c.OnEvicted != nil {
- c.OnEvicted(kv.key, kv.value)
- }
-}
-
-// Len returns the number of items in the cache.
-func (c *Cache) Len() int {
- if c.cache == nil {
- return 0
- }
- return c.ll.Len()
-}
-
-// Clear purges all stored items from the cache.
-func (c *Cache) Clear() {
- if c.OnEvicted != nil {
- for _, e := range c.cache {
- kv := e.Value.(*entry)
- c.OnEvicted(kv.key, kv.value)
- }
- }
- c.ll = nil
- c.cache = nil
-}
diff --git a/vendor/vendor.json b/vendor/vendor.json
index c30ecbf25..b87802714 100644
--- a/vendor/vendor.json
+++ b/vendor/vendor.json
@@ -61,12 +61,6 @@
"versionExact": "v0.1.0"
},
{
- "checksumSHA1": "LHNzQwau1zPeFPPG5zbNf8AgUOQ=",
- "path": "github.com/golang/groupcache/lru",
- "revision": "5b532d6fd5efaf7fa130d4e859a2fde0fc3a9e1b",
- "revisionTime": "2019-01-29T15:46:38Z"
- },
- {
"checksumSHA1": "BP2buXHHOKxI5eYS2xELVng2kf4=",
"path": "github.com/golang/protobuf/jsonpb",
"revision": "c823c79ea1570fb5ff454033735a8e68575d1d0f",