Skip to content

Commit 61a0fc6

Browse files
GODRIVER-3173 Update APR
1 parent 4cc9b31 commit 61a0fc6

File tree

6 files changed

+259
-113
lines changed

6 files changed

+259
-113
lines changed

bson/default_value_encoders.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package bson
99
import (
1010
"encoding/json"
1111
"errors"
12+
"fmt"
1213
"math"
1314
"net/url"
1415
"reflect"
@@ -165,6 +166,7 @@ func decimal128EncodeValue(_ EncodeContext, vw ValueWriter, val reflect.Value) e
165166
if !val.IsValid() || val.Type() != tDecimal {
166167
return ValueEncoderError{Name: "Decimal128EncodeValue", Types: []reflect.Type{tDecimal}, Received: val}
167168
}
169+
fmt.Println(val.Interface().(Decimal128))
168170
return vw.WriteDecimal128(val.Interface().(Decimal128))
169171
}
170172

internal/integration/csot_prose_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ func TestCSOTProse(t *testing.T) {
176176
time.Millisecond,
177177
"expected ping to fail within 150ms")
178178
})
179+
179180
})
180181

181182
mt.RunOpts("11. multi-batch bulkWrites", mtest.NewOptions().MinServerVersion("8.0").
@@ -232,6 +233,9 @@ func TestCSOTProse(t *testing.T) {
232233
assert.ErrorIs(mt, err, context.DeadlineExceeded, "expected a timeout error, got: %v", err)
233234
assert.Equal(mt, 2, cnt, "expected bulkWrite calls: %d, got: %d", 2, cnt)
234235
})
236+
237+
//mt.Run("pending read", func(mt *mtest.T) {
238+
//})
235239
}
236240

237241
func TestCSOTProse_GridFS(t *testing.T) {

internal/integration/unified/unified_spec_runner.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ func runTestFile(t *testing.T, filepath string, expectValidFail bool, opts ...*O
122122
defer func() {
123123
// catch panics from looking up elements and fail if it's unexpected
124124
if r := recover(); r != nil {
125+
126+
panic(r)
125127
if !expectValidFail {
126128
mt.Fatal(r)
127129
}

x/mongo/driver/topology/connection.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type pendingReadState struct {
5151
remainingBytes int32
5252
requestID int32
5353
remainingTime *time.Duration
54+
start time.Time
5455
}
5556

5657
type connection struct {
@@ -490,12 +491,13 @@ func (c *connection) read(ctx context.Context) (bytesRead []byte, errMsg string,
490491
if l := int32(n); l == 0 && isCSOTTimeout(err) && driverutil.HasMaxTimeMS(ctx) {
491492
requestID, _ := driverutil.GetRequestID(ctx)
492493

493-
c.pendingReadMu.Lock()
494+
//c.pendingReadMu.Lock()
494495
c.pendingReadState = &pendingReadState{
495496
remainingBytes: l,
496497
requestID: requestID,
498+
start: time.Now(),
497499
}
498-
c.pendingReadMu.Unlock()
500+
//c.pendingReadMu.Unlock()
499501
}
500502
return nil, "incomplete read of message header", err
501503
}
@@ -513,12 +515,13 @@ func (c *connection) read(ctx context.Context) (bytesRead []byte, errMsg string,
513515
if remainingBytes > 0 && isCSOTTimeout(err) && driverutil.HasMaxTimeMS(ctx) {
514516
requestID, _ := driverutil.GetRequestID(ctx)
515517

516-
c.pendingReadMu.Lock()
518+
//c.pendingReadMu.Lock()
517519
c.pendingReadState = &pendingReadState{
518520
remainingBytes: remainingBytes,
519521
requestID: requestID,
522+
start: time.Now(),
520523
}
521-
c.pendingReadMu.Unlock()
524+
//c.pendingReadMu.Unlock()
522525
}
523526
return dst, "incomplete read of full message", err
524527
}

0 commit comments

Comments
 (0)