-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Panic in marshalling ResourceSpans #1985
Comments
Yes, can you provide a test that proves this? |
Created PR with test that panics |
@Vemmy124 thanks a lot for the repro. Since you went this far are you perhaps also able provide the fix for the bug? |
@tigrannajaryan I would like to discuss the solution here, because I think it implies a lot of work. Already started to think about this. |
One option that I have in mind and looking to do is actually to change all fields to be not-nullable, which will avoid this case. |
BTW, what was the purpose of nullable fields? I don't really understand. There are comments everywhere like "panics on non-initialized structure" and it's very hard to understand semantical difference between nil and zero-initialized structure |
That is how protobuf by default generates repeated fields (slices), as a slice to pointer of objects. I think this is historical because iterating with range over a slice of objects (not pointers) was slow (it may still be, not sure if it was fixed) because Here is a proposal that includes your test: #2002 |
We modeled a bit too much on the proto generated code to avoid allocating nil objects. But I think we can make all the objects not nullable and remove that confusion |
@bogdandrutu @tigrannajaryan SGTM, would you like me to provide PR for that or we're still trying to agree on the idea? |
As long as there are no nil objects now, we can close the issue |
* Remove InstallNewPipeline/NewExportPipeline funcs * Rename stdout NewExporter to New * Rename prometheus NewExporter func to New * Rename Jaeger exporter NewRawExporter func to New * Rename zipkin exporter NewRawExporter func to New * Rename otlp exporter creation funcs * Rename processortest exporter creation funcs * Update PR number in changelog * Fix spelling error * Rename remaining NewUnstartedExporter in otlp * Remove unused testing file
Describe the bug
Marshalling
otlpcollectortrace.ExportTraceServiceRequest
panics if there are nil components inResourceSpans
(e.g. nilInstrumetationLibrarySpans
). Can we fix that somehow?The text was updated successfully, but these errors were encountered: