Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Nov 6, 2023
1 parent 5118fa1 commit 6e5ef26
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
10 changes: 8 additions & 2 deletions mongo/integration/unified/testrunner_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,14 @@ func executeTestRunnerOperation(ctx context.Context, operation *operation, loopD
}
return nil
case "runOnThread":
// TODO
return nil
operationRaw, err := args.LookupErr("operation")
if err != nil {
return fmt.Errorf("'operation' argument not found in runOnThread operation")
}
if err := operationRaw.Unmarshal(operation); err != nil {
return fmt.Errorf("error unmarshalling 'operation' argument: %v", err)
}
return operation.execute(ctx, loopDone)
case "waitForThread":
// TODO
return nil
Expand Down
10 changes: 6 additions & 4 deletions x/mongo/driver/topology/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,10 +863,12 @@ func (p *pool) interruptInUseConnections() {
return
}

if atomic.LoadInt64(&conn.state) == connConnected {
conn.closeConnectContext()
conn.wait() // Make sure that the connection has finished connecting.
}
/*
if atomic.LoadInt64(&conn.state) == connConnected {
conn.closeConnectContext()
conn.wait() // Make sure that the connection has finished connecting.
}
*/

_ = conn.closeWithErr(poolClearedError{
err: fmt.Errorf("interrupted"),
Expand Down
2 changes: 1 addition & 1 deletion x/mongo/driver/topology/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ func (s *Server) update() {
s.updateDescription(desc)
// Retry after the first timeout before clearing the pool in case of a FAAS pause as
// described in GODRIVER-2577.
if err := unwrapConnectionError(desc.LastError); err != nil && timeoutCnt < 1 {
if err := unwrapConnectionError(desc.LastError); err != nil && timeoutCnt < 0 {
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
timeoutCnt++
// We want to immediately retry on timeout error. Continue to next loop.
Expand Down
1 change: 1 addition & 0 deletions x/mongo/driver/topology/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (d *timeoutDialer) DialContext(ctx context.Context, network, address string

// TestServerHeartbeatTimeout tests timeout retry for GODRIVER-2577.
func TestServerHeartbeatTimeout(t *testing.T) {
t.Skip("skipping for GODRIVER-2335")
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
Expand Down

0 comments on commit 6e5ef26

Please sign in to comment.