Skip to content

Commit

Permalink
Merge pull request #1 from jackyvictory/v2
Browse files Browse the repository at this point in the history
fix(#11319): reset server.abended state after successful isMaster call
  • Loading branch information
ncubrian authored Jul 19, 2017
2 parents 3f83fa5 + 2cf0b2c commit 3d98510
Show file tree
Hide file tree
Showing 29 changed files with 47 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go

go_import_path: gopkg.in/mgo.v2
go_import_path: github.com/CardInfoLink/mgo

addons:
apt:
Expand Down
4 changes: 2 additions & 2 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
"fmt"
"sync"

"gopkg.in/mgo.v2/bson"
"gopkg.in/mgo.v2/internal/scram"
"github.com/CardInfoLink/mgo/bson"
"github.com/CardInfoLink/mgo/internal/scram"
)

type authCmd struct {
Expand Down
2 changes: 1 addition & 1 deletion auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"time"

. "gopkg.in/check.v1"
"gopkg.in/mgo.v2"
"github.com/CardInfoLink/mgo"
)

func (s *S) TestAuthLoginDatabase(c *C) {
Expand Down
2 changes: 1 addition & 1 deletion bson/bson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"time"

. "gopkg.in/check.v1"
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
"gopkg.in/yaml.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion bson/decimal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"regexp"
"strings"

"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"

. "gopkg.in/check.v1"
)
Expand Down
2 changes: 1 addition & 1 deletion bson/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/base64"
"fmt"
"gopkg.in/mgo.v2/internal/json"
"github.com/CardInfoLink/mgo/internal/json"
"strconv"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion bson/json_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package bson_test

import (
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"

. "gopkg.in/check.v1"
"reflect"
Expand Down
2 changes: 1 addition & 1 deletion bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"sort"

"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
)

// Bulk represents an operation that can be prepared with several
Expand Down
2 changes: 1 addition & 1 deletion bulk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package mgo_test

import (
. "gopkg.in/check.v1"
"gopkg.in/mgo.v2"
"github.com/CardInfoLink/mgo"
)

func (s *S) TestBulkInsert(c *C) {
Expand Down
6 changes: 5 additions & 1 deletion cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"sync"
"time"

"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
)

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -646,6 +646,10 @@ func (cluster *mongoCluster) AcquireSocket(mode Mode, slaveOk bool, syncTimeout
cluster.syncServers()
time.Sleep(100 * time.Millisecond)
continue
} else {
server.Lock()
server.abended = false
server.Unlock()
}
}
return s, nil
Expand Down
4 changes: 2 additions & 2 deletions cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (
"time"

. "gopkg.in/check.v1"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/bson"
)

func (s *S) TestNewSession(c *C) {
Expand Down
2 changes: 1 addition & 1 deletion dbtest/dbserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
"time"

"gopkg.in/mgo.v2"
"github.com/CardInfoLink/mgo"
"gopkg.in/tomb.v2"
)

Expand Down
4 changes: 2 additions & 2 deletions dbtest/dbserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

. "gopkg.in/check.v1"

"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/dbtest"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/dbtest"
)

type M map[string]interface{}
Expand Down
2 changes: 1 addition & 1 deletion gridfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"sync"
"time"

"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
)

type GridFS struct {
Expand Down
4 changes: 2 additions & 2 deletions gridfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"time"

. "gopkg.in/check.v1"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/bson"
)

func (s *S) TestGridFSCreate(c *C) {
Expand Down
2 changes: 1 addition & 1 deletion internal/scram/scram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

. "gopkg.in/check.v1"
"gopkg.in/mgo.v2/internal/scram"
"github.com/CardInfoLink/mgo/internal/scram"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion saslimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package mgo

import (
"gopkg.in/mgo.v2/internal/sasl"
"github.com/CardInfoLink/mgo/internal/sasl"
)

func saslNew(cred Credential, host string) (saslStepper, error) {
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"sync"
"time"

"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
)

// ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
"sync"
"time"

"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
)

type Mode int
Expand Down
4 changes: 2 additions & 2 deletions session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import (
"time"

. "gopkg.in/check.v1"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/bson"
)

func (s *S) TestRunString(c *C) {
Expand Down
2 changes: 1 addition & 1 deletion socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"sync"
"time"

"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
)

type replyFunc func(err error, reply *replyOp, docNum int, docData []byte)
Expand Down
4 changes: 2 additions & 2 deletions suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import (
"time"

. "gopkg.in/check.v1"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/bson"
)

var fast = flag.Bool("fast", false, "Skip slow tests")
Expand Down
2 changes: 1 addition & 1 deletion txn/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"sync/atomic"

"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions txn/flusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package txn
import (
"fmt"

"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/bson"
)

func flush(r *Runner, t *transaction) error {
Expand Down
8 changes: 4 additions & 4 deletions txn/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package txn_test

import (
"flag"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"gopkg.in/mgo.v2/dbtest"
"gopkg.in/mgo.v2/txn"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/bson"
"github.com/CardInfoLink/mgo/dbtest"
"github.com/CardInfoLink/mgo/txn"
. "gopkg.in/check.v1"
"math/rand"
"time"
Expand Down
2 changes: 1 addition & 1 deletion txn/tarjan.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package txn

import (
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
"sort"
)

Expand Down
2 changes: 1 addition & 1 deletion txn/tarjan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package txn

import (
"fmt"
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo/bson"
. "gopkg.in/check.v1"
)

Expand Down
4 changes: 2 additions & 2 deletions txn/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"strings"
"sync"

"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/bson"

crand "crypto/rand"
mrand "math/rand"
Expand Down
8 changes: 4 additions & 4 deletions txn/txn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"time"

. "gopkg.in/check.v1"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"gopkg.in/mgo.v2/dbtest"
"gopkg.in/mgo.v2/txn"
"github.com/CardInfoLink/mgo"
"github.com/CardInfoLink/mgo/bson"
"github.com/CardInfoLink/mgo/dbtest"
"github.com/CardInfoLink/mgo/txn"
)

func TestAll(t *testing.T) {
Expand Down

0 comments on commit 3d98510

Please sign in to comment.