Skip to content

Conversation

pluma9
Copy link

@pluma9 pluma9 commented Dec 19, 2020

CreateJsonSerializer() may return a serializer that was previously returned to the pool. This means this serializer's Error event already have a subscriber. If we try to add more subscribers (jsonSerializer.Error += errorHandler;), the errorHandler will be invoked multiple times when the serializer fail to Deserialize. Therefore, we need to remove the subscriber before returning the serializer to the pool.

Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@pluma9 pluma9 changed the title Fixed issue where errorHandler in BsonInputFormatter is voked multitple times Fixed issue where errorHandler in BsonInputFormatter is invoked multitple times Dec 20, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants