-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 2.5
-
Component/s: Operations
-
None
-
(copied to CRM)
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; } } }