hot restarter: Log errno for 'panic: cannot open shared memory' error#4032
Merged
mattklein123 merged 2 commits intoenvoyproxy:masterfrom Aug 2, 2018
Merged
Conversation
The error message right now assumes that the errno is EACCESS which isn't necessarily true. Logging the errno makes this easier to debug. Signed-off-by: Julia Evans <julia@stripe.com>
mattklein123
reviewed
Aug 2, 2018
Member
mattklein123
left a comment
There was a problem hiding this comment.
LGTM. Can you fix format? Thank you!
mattklein123
reviewed
Aug 2, 2018
source/server/hot_restart_impl.cc
Outdated
| int shmem_fd = os_sys_calls.shmOpen(shmem_name.c_str(), flags, S_IRUSR | S_IWUSR); | ||
| if (shmem_fd == -1) { | ||
| PANIC(fmt::format("cannot open shared memory region {} check user permissions", shmem_name)); | ||
| PANIC(fmt::format("cannot open shared memory region {} check user permissions. Error code: {}", shmem_name, errno)); |
Member
There was a problem hiding this comment.
Might also consider strerror() here, but not a big deal either way if you have a preference.
Signed-off-by: Julia Evans <julia@stripe.com>
ggreenway
approved these changes
Aug 2, 2018
mattklein123
approved these changes
Aug 2, 2018
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.
Description:
We've been seeing very frequent
panic: cannot open shared memory region /envoy_shared_memory_160 check user permissionserrors. This error message assumes that the reason the file can't be opened is because of permissions (EACCESS), but this can be misleading -- there are many reasons files might fail to open. In our case the cause was that the file didn't exist (ENOENT).Logging the errno makes this particular error much easier to debug.
Risk Level: low
Testing: Ran in our QA cluster