-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Same Key Added Exception in ExceptionPropertiesBag #465
Comments
From a quick look, it may be the case that we actually handle duplicate names incorrectly in this scenario. |
@jaytilly on the second look, I change my mind, I don't know how to reproduce this one. Why do you think this involves some threading issue? |
@krajek, I don't (yet) have exact repro steps that can be followed or a code-base that I can share freely but I arrived at the possibility of threading due to the places in code that the error tends to occur around. It seems to be in areas where there is a lot of concurrency with the same exception(s) being thrown on different threads. I'll dig in to try and narrow down the cause a bit later in the day. I appreciate the quick reply. |
The |
Anyone had a chance to look at resolving this? |
Describe the bug
While using in the field within a heavily multi-threaded application, it was found that we there are cases in which a handled exception in user code was being passed to Serilog where the reflection part of this enricher was throwing the error below. I'd be more than happy to help with a fix if needed but wanted to create the bug report before creating a PR in case this was a known issue with a fix in place.
It appears that the
ExceptionPropertiesBag
could be made thread safe by using either locks when accessing the Dictionary or by using a ConcurrentDictionary without affecting too much of the existing code.Version:
Using Version 8.0.0 with additional duplicate key handling:
3445242
Platform:
Xamarin Forms, primarily targeting iOS
Steps to reproduce
This is hard to reproduce as it needs the same or similar exceptions being thrown in multiple environments. This tends to happen in code that does many retries such as HTTP retries or other error prone / retry heavy code in which the exceptions are being caught and logged.
Expected behaviour
When this exception occurs, the app does a hard crash and does not always push the error out to file logs though the logs can be retrieved from the Console while debugging.
The text was updated successfully, but these errors were encountered: