Replace panics in dynamic location handling with safe fallback#287
Closed
utpilla wants to merge 1 commit into
Closed
Replace panics in dynamic location handling with safe fallback#287utpilla wants to merge 1 commit into
utpilla wants to merge 1 commit into
Conversation
|
|
||
| LocationType::DynAbsolute => { | ||
| todo!("Need to support absolute location"); | ||
| LocationType::DynRelative | LocationType::DynAbsolute => { |
Collaborator
There was a problem hiding this comment.
We need to handle these, as the data closure generation calls into get_field_data_closure() which eventually leads here. get_field_data_closure() should be updated to handle these cases as well as this function.
The todo() here is to track that work is yet to be done. We should either do the work here or keep the todo() since it's tracking that left over work.
Contributor
Author
|
Closing in favor of #293 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
EventFormat::get_data_with_offset_directhad twotodo!()arms forLocationType::DynRelativeandLocationType::DynAbsolutethat panic the process if hit. This change replaces them with a single combined arm that returnsEMPTY, matching the behavior of every other failure path in the same function.Motivation
These variants are produced by Linux
tracefs(parsing__rel_loc/__dyn_locmarkers) and by the cross-platformScriptEvent::append_fieldhelper. Whether any current caller actually feeds such a field intoget_data_with_offset_directis not obvious from a single review pass. For example: open-telemetry/otel-arrow#3187 (comment)A
todo!()here forces reviewer to either:catch_unwind, etc.) around callers, orBoth are wasted effort for a function whose every other failure mode already returns
EMPTY.todo!()is a "not implemented yet" marker; using it in shipped code as a stand-in for "shouldn't happen" promotes a missing feature to a potential process-killing panic and adds review friction.