fix: Only call get_all_running_processes_info when needed
#4135
+4
−1
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.
Do not call
get_all_running_processes_info()unless the log level requires printing debug logs.When running micromamba in a specific production environment, we keep getting
Segmentation fault (core dumped)and, by adding more logs in the code, I was able to narrow it down to this particular log entry, where it tries to print the currently running processes. I can confirm that the crash doesn't occur inget_all_running_processes_info()and it is something in theMessageLoggerimplementation, but I have a hard time narrowing it down since I don't have access to run gdb in that environment or collect core dumps. I believe it is something to do with the length of the resulting string, but I've not been able to get it to reproduce reliably in a unit test. However, we don't use debug logs and, in this case, I think the code should skip this log clause completely, which should unblock us.Description
Type of Change
Checklist
pre-commit run --alllocally in the source folder and confirmed that there are no linter errors.