-
Notifications
You must be signed in to change notification settings - Fork 926
GODRIVER-3858 message size exceeds limit of 48000000 #2360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/2.5
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,9 +36,10 @@ func TestAppendBatchSequence(t *testing.T) { | |
| batches := newTestBatches(t) | ||
|
|
||
| got := []byte{42} | ||
| totalMsgSize := len(batches.Documents[0]) + len(batches.Documents[1]) | ||
| var n int | ||
| var err error | ||
| n, got, err = batches.AppendBatchSequence(got, 2, len(batches.Documents[0])) | ||
| n, got, err = batches.AppendBatchSequence(got, 2, totalMsgSize) | ||
| assert.NoError(t, err) | ||
| assert.Equal(t, 1, n) | ||
|
|
||
|
|
@@ -57,9 +58,10 @@ func TestAppendBatchArray(t *testing.T) { | |
| batches := newTestBatches(t) | ||
|
|
||
| got := []byte{42} | ||
| totalMsgSize := len(batches.Documents[0]) + len(batches.Documents[1]) | ||
| var n int | ||
| var err error | ||
| n, got, err = batches.AppendBatchArray(got, 2, len(batches.Documents[0])) | ||
| n, got, err = batches.AppendBatchArray(got, 2, totalMsgSize) | ||
|
||
| assert.NoError(t, err) | ||
| assert.Equal(t, 1, n) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totalMsgSizeis not actually the total message size here (it excludes OP_MSG/section overhead and also includes the size of a document that isn’t expected to be appended). This makes the test’s intent fragile and tied to the current overhead/identifier length. Consider computing the size limit from the expected encoded bytes (e.g., builddstfirst and uselen(dst)+/- 1) and/or rename the variable to reflect that it’s a size limit rather than an actual message size.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have renamed the variable