diff --git a/go.mod b/go.mod index 62146f3a..e4bef371 100644 --- a/go.mod +++ b/go.mod @@ -10,5 +10,5 @@ require ( github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.6.1 github.com/urfave/cli v1.22.5 - go.mongodb.org/mongo-driver v1.4.4 + go.mongodb.org/mongo-driver v1.4.6 ) diff --git a/go.sum b/go.sum index c02e7329..20171c13 100644 --- a/go.sum +++ b/go.sum @@ -266,8 +266,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.4.2 h1:WlnEglfTg/PfPq4WXs2Vkl/5ICC6hoG8+r+LraPmGk4= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.4 h1:bsPHfODES+/yx2PCWzUYMH8xj6PVniPI8DQrsJuSXSs= -go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= +go.mongodb.org/mongo-driver v1.4.6 h1:rh7GdYmDrb8AQSkF8yteAus8qYOgOASWDOv1BWqBXkU= +go.mongodb.org/mongo-driver v1.4.6/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go index dd560c96..b83012b2 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go @@ -159,29 +159,18 @@ func (ejvr *extJSONValueReader) pop() { } } -func (ejvr *extJSONValueReader) skipDocument() error { - // read entire document until ErrEOD (using readKey and readValue) - _, typ, err := ejvr.p.readKey() - for err == nil { - _, err = ejvr.p.readValue(typ) - if err != nil { - break +func (ejvr *extJSONValueReader) skipObject() { + // read entire object until depth returns to 0 (last ending } or ] seen) + depth := 1 + for depth > 0 { + ejvr.p.advanceState() + switch ejvr.p.s { + case jpsSawBeginObject, jpsSawBeginArray: + depth++ + case jpsSawEndObject, jpsSawEndArray: + depth-- } - - _, typ, err = ejvr.p.readKey() } - - return err -} - -func (ejvr *extJSONValueReader) skipArray() error { - // read entire array until ErrEOA (using peekType) - _, err := ejvr.p.peekType() - for err == nil { - _, err = ejvr.p.peekType() - } - - return err } func (ejvr *extJSONValueReader) invalidTransitionErr(destination mode, name string, modes []mode) error { @@ -234,30 +223,9 @@ func (ejvr *extJSONValueReader) Skip() error { t := ejvr.stack[ejvr.frame].vType switch t { - case bsontype.Array: - // read entire array until ErrEOA - err := ejvr.skipArray() - if err != ErrEOA { - return err - } - case bsontype.EmbeddedDocument: - // read entire doc until ErrEOD - err := ejvr.skipDocument() - if err != ErrEOD { - return err - } - case bsontype.CodeWithScope: - // read the code portion and set up parser in document mode - _, err := ejvr.p.readValue(t) - if err != nil { - return err - } - - // read until ErrEOD - err = ejvr.skipDocument() - if err != ErrEOD { - return err - } + case bsontype.Array, bsontype.EmbeddedDocument, bsontype.CodeWithScope: + // read entire array, doc or CodeWithScope + ejvr.skipObject() default: _, err := ejvr.p.readValue(t) if err != nil { diff --git a/vendor/go.mongodb.org/mongo-driver/version/version.go b/vendor/go.mongodb.org/mongo-driver/version/version.go index c88552fd..459e5707 100644 --- a/vendor/go.mongodb.org/mongo-driver/version/version.go +++ b/vendor/go.mongodb.org/mongo-driver/version/version.go @@ -7,4 +7,4 @@ package version // import "go.mongodb.org/mongo-driver/version" // Driver is the current version of the driver. -var Driver = "v1.4.4" +var Driver = "v1.4.6" diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/batch_cursor.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/batch_cursor.go index ae235fda..2d7339d4 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/batch_cursor.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/batch_cursor.go @@ -241,7 +241,7 @@ func (bc *BatchCursor) getMore(ctx context.Context) { // Required for legacy operations which don't support limit. numToReturn := bc.batchSize - if bc.limit != 0 && bc.numReturned+bc.batchSize > bc.limit { + if bc.limit != 0 && bc.numReturned+bc.batchSize >= bc.limit { numToReturn = bc.limit - bc.numReturned if numToReturn <= 0 { err := bc.Close(ctx) diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/errors.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/errors.go index dfa3ef50..c543bacb 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/errors.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/errors.go @@ -1,6 +1,8 @@ package topology -import "fmt" +import ( + "fmt" +) // ConnectionError represents a connection error. type ConnectionError struct { @@ -25,3 +27,22 @@ func (e ConnectionError) Error() string { func (e ConnectionError) Unwrap() error { return e.Wrapped } + +// WaitQueueTimeoutError represents a timeout when requesting a connection from the pool +type WaitQueueTimeoutError struct { + Wrapped error +} + +// Error implements the error interface. +func (w WaitQueueTimeoutError) Error() string { + errorMsg := "timed out while checking out a connection from connection pool" + if w.Wrapped != nil { + return fmt.Sprintf("%s: %s", errorMsg, w.Wrapped.Error()) + } + return errorMsg +} + +// Unwrap returns the underlying error. +func (w WaitQueueTimeoutError) Unwrap() error { + return w.Wrapped +} diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/pool.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/pool.go index f94a4c73..0a4fe487 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/pool.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/pool.go @@ -31,9 +31,6 @@ var ErrConnectionClosed = ConnectionError{ConnectionID: "", message: "co // ErrWrongPool is return when a connection is returned to a pool it doesn't belong to. var ErrWrongPool = PoolError("connection does not belong to this pool") -// ErrWaitQueueTimeout is returned when the request to get a connection from the pool timesout when on the wait queue -var ErrWaitQueueTimeout = PoolError("timed out while checking out a connection from connection pool") - // PoolError is an error returned from a Pool method. type PoolError string @@ -340,7 +337,10 @@ func (p *pool) get(ctx context.Context) (*connection, error) { Reason: event.ReasonTimedOut, }) } - return nil, ErrWaitQueueTimeout + errWaitQueueTimeout := WaitQueueTimeoutError{ + Wrapped: ctx.Err(), + } + return nil, errWaitQueueTimeout } // This loop is so that we don't end up with more than maxPoolSize connections if p.conns.Maintain runs between diff --git a/vendor/modules.txt b/vendor/modules.txt index 753a51ec..a39cecdf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -115,7 +115,7 @@ github.com/urfave/cli github.com/xdg/scram # github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc github.com/xdg/stringprep -# go.mongodb.org/mongo-driver v1.4.4 +# go.mongodb.org/mongo-driver v1.4.6 ## explicit go.mongodb.org/mongo-driver/bson go.mongodb.org/mongo-driver/bson/bsoncodec