You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Elastic.Clients.Elasticsearch version: 8.16.1 (works in 8.14.6)
When writing data using PostData.MultiJson, the FinishStream(Async) method is incorrectly duplicating data into the same buffer when disableDirectStreaming is set to true. This happens because BufferIfNeeded modifies writableStream by reference to use a newly created MemoryStream buffer, but FinishStream later uses the same writableStream (now the buffer) for copying, resulting in self-copying and data duplication.
Steps to Reproduce
Use PostData.MultiJson with disableDirectStreaming set to true.
Observe that the data in WrittenBytes is duplicated.
Solution
I think, the issue can be resolved by introducing a local variable stream to hold the current writing stream, ensuring that the original writableStream remains distinct from the buffer. The local stream is used for writing data, while the original writableStream is used correctly in FinishStream.
Elastic.Clients.Elasticsearch version: 8.16.1 (works in 8.14.6)
When writing data using PostData.MultiJson, the FinishStream(Async) method is incorrectly duplicating data into the same buffer when disableDirectStreaming is set to true. This happens because BufferIfNeeded modifies writableStream by reference to use a newly created MemoryStream buffer, but FinishStream later uses the same writableStream (now the buffer) for copying, resulting in self-copying and data duplication.
Steps to Reproduce
Use PostData.MultiJson with disableDirectStreaming set to true.
Observe that the data in WrittenBytes is duplicated.
Solution
I think, the issue can be resolved by introducing a local variable stream to hold the current writing stream, ensuring that the original writableStream remains distinct from the buffer. The local stream is used for writing data, while the original writableStream is used correctly in FinishStream.
#149
The text was updated successfully, but these errors were encountered: