Append strerror to listen, /proc/self/status, and header-write errors#914
Merged
Conversation
Follow-up to bloomberg#911. Adds the underlying errno via strerror to three remaining bare error sites so the cause is visible in user-facing messages without raising MEMRAY_LOG_LEVEL: - SocketSink listen() failure (e.g. port already in use) - BackgroundThread /proc/self/status open failure (mount ns, EMFILE, permission drop) - Tracker ctor "Failed to write output header" RuntimeError, which surfaces in Python tracebacks (bloomberg#731) errno is captured into a local immediately after each failure check, before any close()/string-allocation that could clobber it. Skips the FileSink::seek munmap path: only reachable via a bug or memory corruption, so not worth the maintenance cost. Signed-off-by: Suyog Bhise <bhise.suyog@gmail.com>
godlygeek
reviewed
May 3, 2026
- Shorten news/747.feature.rst per reviewer wording. - Drop saved_errno locals; strerror(errno) is sequenced before the std::string operations on the same line. - Compute strerror once in SocketSink::open and reuse for both log and exception message. - Replace <cstring> with <stdio.h> for strerror in tracking_api.cpp. Signed-off-by: Suyog Bhise <bhise.suyog@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #914 +/- ##
==========================================
- Coverage 92.45% 92.38% -0.08%
==========================================
Files 99 99
Lines 11784 11786 +2
Branches 428 428
==========================================
- Hits 10895 10888 -7
- Misses 889 898 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Follow-up to #911. Append
strerror(errno)to three remaining bare error sites so the cause is visible in tracebacks without raisingMEMRAY_LOG_LEVEL:SocketSink::open—listen()failure (e.g. port already bound).Tracker::BackgroundThread—/proc/self/statusopen failure (mount namespace without/proc, post-privilege-drop,EMFILE).Trackerctor —Failed to write output headerRuntimeError(e.g.ENOSPC,EFBIG,EPIPE).Per maintainer guidance, the
FileSink::seekmunmappath is left unchanged.Test plan
pip install -e . --no-build-isolationpytest tests/passesSocketSinkagainst same port —IoErrorcontainsAddress already in useRuntimeErrortraceback containsNo space left on device