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

Fork-safe read access #9

Open
arsenius7 opened this issue Apr 1, 2019 · 2 comments
Open

Fork-safe read access #9

arsenius7 opened this issue Apr 1, 2019 · 2 comments

Comments

@arsenius7
Copy link
Contributor

It's unsafe to open same H5 file with libsonata after forking.
In the best case, it can end up with errors like that one:

#005: H5C.c line 3574 in H5C_protect(): can't load entry
    major: Symbol table
    major: Object cache
    minor: Protected metadata error
    minor: Unable to load metadata into cache

In the worst case, it can lead to undefined behavior.

This nice trait is inherited from libhdf5; if possible we need to find a way to protect library users from this, or at least make the error more self-explanatory.

@mgeplf
Copy link
Contributor

mgeplf commented Dec 15, 2020

Sadly we don't have a lot of control on how calling process' handle themselves.

However, it would be neat to be able to at least issue a warning if a fork() happens without an exec.
The only (gross) way I can think of this is to save the PID when libsonata is initialized, and periodically check that it hasn't changed; an exec() would clear this, iirc (to be checked).

This doesn't seem like an elegant solution, though.

@mgeplf
Copy link
Contributor

mgeplf commented Dec 15, 2020

@GianlucaFicarelli or @matz-e; do you guys have any thoughts on this? Anyone you recommend I talk to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants