-
Notifications
You must be signed in to change notification settings - Fork 37
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
Exception when non-json metadata is sent and open telemetry is active #316
Comments
Thanks for bringing this to our attention, I will look into this and come back to you shortly. |
Thank you! It's been a great experience so far. My first tests against the current master seem to be fine. Do you have any insight when the next release might be published so we can reference the new nugget package? |
Hey @intens-pavlas I am preparing the patch to be released today as |
Thanks for the quick turnaround, I'm looking forward to it. |
Hey @intens-pavlas
Thanks! |
Hi @josephcummings |
Tested it there @w1am and it's working just fine now. Thank you for the quick turnaround |
Describe the bug
If an event has application/octet-stream metadata (we're using protobuf serialization) and open telemetry is active at the same time then an Exception is thrown in TraceSubscriptionEvent when subscribed on the stream. It is not handled and it is propagated to a client code, where it prevents the event from being received.
To Reproduce
I found some similiraties with #310 .
I was able to borrow his minimal example and modify it to reproduce my behavior.
Replicated code
Steps to reproduce the behavior
"eventstoredb"
JsonDocument
Expected behavior
I think the exception should never be thrown in the first place. However catching the exception in
EventMetadataExtensions.cs:24
->
or
Checking for content type in
EventStoreClient.Subscriptions.cs:231
->
both worked well for me as a quick fix.
Actual behavior
The exception is thrown before the event is passed to the client code - preventing the event from being received.
Config/Logs/Screenshots
EventStore details
Additional context
What is little odd to me is even before this all happens. In
EventMetadataExtensions.cs:54
TryInjectTracingMetadata
there is an attempt to parse stream into json document and if it fails, it will pass through original stream, which probably allows bad characters to propagate through. Maybe it shouldn't be even initiated when arbitrary application/octet-stream is sent. Or there should be some other way to trace such metadata. This is probably up to you to evaluate further.The text was updated successfully, but these errors were encountered: