-
Notifications
You must be signed in to change notification settings - Fork 296
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
Lock usage of YamlDotNet Serializer and Deserializer #1544
Lock usage of YamlDotNet Serializer and Deserializer #1544
Conversation
|
Welcome @alxmitch! |
YamlDotNet ISerializer and IDeserializer are not thread-safe
a77ba1d
to
09f8f20
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1544 +/- ##
=========================================
Coverage ? 61.46%
=========================================
Files ? 103
Lines ? 3065
Branches ? 637
=========================================
Hits ? 1884
Misses ? 1181
Partials ? 0 ☔ View full report in Codecov by Sentry. |
/LGTM |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alxmitch, tg123 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi, I am hitting the issue in our environment, and it is great to see the fix. May I know when will be a new release to include this fix? Thanks! |
13.0.37 is now published |
I'm curious, why did we opt for lock instead of ThreadLocal? We're using this library within an ASP.NET Core service that handles concurrent requests. The concern with lock is the potential performance overhead it introduces. |
@shenglol for now, it is a quick, dirty and safest solution. could you please send a pr of suggesting optimization? |
YamlDotNet
ISerializer
/IDeserializer
is not thread safe. This PR prevents concurrent use of the static serializers and deserializer inKubernetesYaml
.Addresses #1537
I have verified locally that this resolves the failing test in the linked PoC for the original issue, but have not included that test here as it didn't always reliably reproduce the issue. Keen for advice on appropriate testing around this change.