-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Fix empty byte[] bug in EventSource #52602
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1790ee3
Fix empty byte[] bug in EventSource
MihaZupan 277d48f
Add some non-zero data to byte[] tests
MihaZupan c61141c
Remove leftover usings from testing
MihaZupan cb9cce3
Merge main
MihaZupan da53d41
Return Array.Empty for empty byte[]
MihaZupan 2931c59
Pass correct pointer to Marshal copy
MihaZupan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be simpler and safer as:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I had used initially, but it sadly involves duplicating the logic under
#if #else
asEventSource
is also being built standalone (no Span)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not reference the netstandard span package from the downlevel solution?
Either way, I don't think we should penalize the latest platform because of the source sharing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brianrob, we still maintain/ship the separate EventSource package? Who uses that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100% agree with this.
This periodically comes up (see: #32276 (comment)). This is building this package, which is used to ship EventSource features out-of-band for older framework releases. Download counts have been dwindling since 2015. The 5.0 version has ~320k downloads in 7 months.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we still adding new EventSource features it's important to be able to release in this vehicle? Can we just stop shipping new versions of it? If it's about bug fixes as Brian mentions in the linked comment, can we just treat it as servicing and fix bugs out of release/5.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with moving that to a servicing life cycle. Brian has a better sense of what impact that would have though, so I would defer to his input before ripping it out.
CC @noahfalk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EventSource package is really used for two things:
The package only targets .NET Framework, so anything for .NET Core would just go through the standard servicing process. It's not clear to me that we're adding new features to EventSource at a rate that really requires the package - for me, the question is really whether or not we need a relief valve to be able to fix issues on .NET Framework. If we can do that through a servicing release, then that's fine, but I worry that .NET 5 will only be supported for so long and then we lose the infrastructure and shipping support for this. Over time, as we move folks towards .NET Core, this package becomes less and less important, but I don't think we're in a place where we'll be ready in a year or two to just stop producing the package, even through servicing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make sure I understand, this doesn't actually unify with what's in .NET Framework, right? Someone has to explicitly switch from using the EventSource in .NET Framework to this differently namespaced type in the OOB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right - it does not unify. Someone will have to explicitly consume the NuGet package. The namespace is also different -
Microsoft.Diagnostics.Tracing
instead ofSystem.Diagnostics.Tracing
.