fix: reduce log noise and filename duplication#467
fix: reduce log noise and filename duplication#467fabled merged 7 commits intoopen-telemetry:mainfrom areebahmeddd:issues/466/error-logging
Conversation
florianl
left a comment
There was a problem hiding this comment.
While changing the visibility of the log line from Error to Debug, reduces the logged output, if the OTel eBPF profiler is not running in verbose mode, it does not resolve the underlying issue, that causes the error log line.
The log lines in #466 indicate a race condition somewhere between Go and Rust (?). As a result, symbolization will fail for this part. I would prefer, if we could fix the race condition and guarantee less symbolization issues, rather changing the visibility for issue.
@florianl are you sure this isn't just an expected TOCTOU? If it is, using debug level seems fine to me. Otherwise, I agree with you that the issue should be fixed and the log should stay at error level. @areebahmeddd You are addressing two different issues in your PR, a) simplifying the error message and b) changing the log level / user-visibility. |
|
@rockdaboot updated the pr! ✅ @florianl umm not very familiar with the codebase so from my understanding status code 2 indicates symblib err file not found, so a straightforward fix would be adding a retry mechanism that waits for extracted files to become accessible before passing them to symblib? |
If you compare the current Rust based approach with #456, you will notice that this isn't just an expected TOCTOU - otherwise you would see it with #456 as well.
|
|
I see, thanks for pointing this out. |
|
Anything works! : ) |
fabled
left a comment
There was a problem hiding this comment.
The change on the error message looks good. But the status should be inspected and a equivalent Golang error should be instead embedded if possible.
| if status != C.SYMBLIB_OK { | ||
| return nil, fmt.Errorf("failed to create point resolver for '%s': %d", | ||
| exec, status) | ||
| return nil, fmt.Errorf("failed to create point resolver: %d", | ||
| status) |
There was a problem hiding this comment.
I think the status should be mapped to standard Golang errors where possible. E.g. the -2 indicating file not found, should return an error with os.ErrNotExist embedded in it. This allows the main code path to omit the error logging: its already testing for this specific error code and its not logged.
The root case for this error is indeed race condition. It happens when the earlier code path has opened the ELF file with pfelf.Open successfully, but then during processing of stack deltas or other data the process exits. This causes the above function fail as the mappings file does not exist anymore.
In other interpreters this is already handled correctly, and it does not manifest if this is converted to Go code, because then there is no more attempt to re-open the ELF file with a filename - the cached pfelf.File or the underlying ReaderAt will get used.
There was a problem hiding this comment.
Cool! I've created a function to map standard go errors! Hope it's matches your requirement 🙂
|
I think #456 will take quite a bit of time. Using the Golang built in library will likely explode memory usage. We really need to implement the code in our own code using the mmapped file. The same way the Rust code does it. I think it makes sense to merge this first. Ideally with the mapping of status to |
Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.de>
Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.de>
Signed-off-by: Areeb Ahmed areebshariff@acm.org
Summary of Changes
Changes Golang interpreter loader error handling to reduce log noise and eliminate filename duplication:
C.SYMBLIB_ERR_IOFILENOTFOUND, C.SYMBLIB_ERR_OBJFILE, C.SYMBLIB_ERR_DWARF)Related Issue(s)
Closes #466