Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method 'exists' to core/shm #990

Merged
merged 1 commit into from
Sep 2, 2016
Merged

Conversation

dpino
Copy link
Contributor

@dpino dpino commented Aug 10, 2016

Trying to open a shared memory object which has not been mapped yet results in an error. For instance:

core/shm.lua:37: shm open error (26039/shm/selftest/obj):No such file or directory

I think it would be useful to have an exists method which could be used to check whether an object exists before trying to open it.

@eugeneia eugeneia self-assigned this Aug 22, 2016
@eugeneia
Copy link
Member

I have previously done this by using shm.children and probing the resulting table. Alternatively we could use pcall to catch the error, but that would be less granular. Obviously convenient, merged (I will edit the documentation a bit to describe the return type). 👍

@eugeneia eugeneia merged commit 3ea2348 into snabbco:master Sep 2, 2016
@dpino dpino deleted the shm-exists branch September 6, 2016 06:16
dpino added a commit to dpino/snabb that referenced this pull request Oct 18, 2017
Implement ingress packet drops alarm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants