diff options
author | David Golden <xdg@xdg.me> | 2018-06-14 14:47:28 -0400 |
---|---|---|
committer | David Golden <xdg@xdg.me> | 2018-06-14 15:13:09 -0400 |
commit | b38f034318e969f5a8cbfbcf62f82fceed5018f8 (patch) | |
tree | ca3141ce39a166c813eab8cd4691acb5359b5ace /src/mongo/gotools | |
parent | ef999ac2018d29fd7425ea32df03eaab37d4709b (diff) | |
download | mongo-b38f034318e969f5a8cbfbcf62f82fceed5018f8.tar.gz |
Import tools: ca53f295f44ab94fc7d1a45346c9cdc8b031c370 from branch v4.0
ref: e46dcde715..ca53f295f4
for: 4.1.1
TOOLS-2057 Revendor mgo for another deadlock fix
Diffstat (limited to 'src/mongo/gotools')
-rw-r--r-- | src/mongo/gotools/Godeps | 2 | ||||
-rw-r--r-- | src/mongo/gotools/import.data | 2 | ||||
-rw-r--r-- | src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/session.go | 8 | ||||
-rw-r--r-- | src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/socket.go | 7 |
4 files changed, 9 insertions, 10 deletions
diff --git a/src/mongo/gotools/Godeps b/src/mongo/gotools/Godeps index aaea510c2de..a8abd7e3967 100644 --- a/src/mongo/gotools/Godeps +++ b/src/mongo/gotools/Godeps @@ -1,4 +1,4 @@ -gopkg.in/mgo.v2 913983c541c4a010f8cbe5505dc8dc992a4e8370 github.com/10gen/mgo +gopkg.in/mgo.v2 fd632d79a0f7ffcf190737ba2d5e2548cf56ceeb github.com/10gen/mgo gopkg.in/tomb.v2 14b3d72120e8d10ea6e6b7f87f7175734b1faab8 github.com/jtolds/gls 8ddce2a84170772b95dd5d576c48d517b22cac63 github.com/jacobsa/oglematchers 3ecefc49db07722beca986d9bb71ddd026b133f0 diff --git a/src/mongo/gotools/import.data b/src/mongo/gotools/import.data index 8354583635e..f8673d36a5a 100644 --- a/src/mongo/gotools/import.data +++ b/src/mongo/gotools/import.data @@ -1,5 +1,5 @@ { - "commit": "e46dcde7151b8fcd97a311afdc14de3aad82f10b", + "commit": "ca53f295f44ab94fc7d1a45346c9cdc8b031c370", "github": "mongodb/mongo-tools.git", "vendor": "tools", "branch": "v4.0" diff --git a/src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/session.go b/src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/session.go index 314e5e29ccc..3e234f8318c 100644 --- a/src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/session.go +++ b/src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/session.go @@ -4068,13 +4068,7 @@ func (iter *Iter) getMore() { } else { op = &iter.op } - // We unlock the iterator around socket.Query because it will call the - // replyFunc if the socket is dead, which would deadlock if the iterator - // were still locked. - iter.m.Unlock() - err = socket.Query(op) - iter.m.Lock() - if err != nil { + if err := socket.Query(op); err != nil { iter.docsToReceive-- iter.err = err } diff --git a/src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/socket.go b/src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/socket.go index b287a37fe83..6b4d6a6186d 100644 --- a/src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/socket.go +++ b/src/mongo/gotools/vendor/src/gopkg.in/mgo.v2/socket.go @@ -497,7 +497,12 @@ func (socket *mongoSocket) Query(ops ...interface{}) (err error) { for i := 0; i != requestCount; i++ { request := &requests[i] if request.replyFunc != nil { - request.replyFunc(dead, nil, -1, nil) + // replyFunc expects to be called in socket.readLoop in a + // separate goroutine. We do the same here to preserve + // synchronization expectations and avoid deadlocks. + go func() { + request.replyFunc(dead, nil, -1, nil) + }() } } return dead |