Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
2.5
-
None
-
(copied to CRM)
Description
When calling cursor.MoveNext for a ChangeStreamCursor an EndOfStreamException will be thrown if the batch returned from the server is larger than 64KB.
Can be reproduced for any numberOfChunks >= 1 as follows:
var pipeline = new EmptyPipelineDefinition<ChangeStreamDocument<BsonDocument>>();
|
var options = new ChangeStreamOptions() { FullDocument = ChangeStreamFullDocumentOption.UpdateLookup };
|
using (var cursor = collection.Watch(pipeline, options))
|
{
|
var numberOfChunks = 1;
|
var filler = new string('x', (numberOfChunks - 1) * 65536);
|
var document = new BsonDocument { { "_id", 1 }, { "filler", filler } };
|
collection.InsertOne(document);
|
|
|
while (true)
|
{
|
cursor.MoveNext();
|
var change = cursor.Current.FirstOrDefault();
|
if (change != null)
|
{
|
break;
|
}
|
}
|
}
|