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

Fix OverlappingFileLockException #95

Closed

Conversation

jbettcher
Copy link

@jbettcher jbettcher commented Mar 21, 2022

This is a potential fix for #93. I'm not 100% this is the right fix: the fundamental issue seems to be that multiple threads may be trying to lock the soDirectory at the same time. This change will catch the OverlappingFileLockException and allow execution to continue, although tryLock will return null in this case.

In my testing this does resolve the crash and seems to allow SoLoader to continue loading all of our native libs, but I'd like someone familiar with the code to vet the change in case there are edge cases I'm unfamiliar with.

@facebook-github-bot
Copy link

Hi @jbettcher!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@passy
Copy link
Member

passy commented Mar 22, 2022

Hi Jon! It's been a while since I've run into your code at the ol' Bird Factory. I'm not the best person to review this but if you could sign the CLA, I'd be happy to import this and have someone internally take a look.

@jbettcher
Copy link
Author

Pascal! Good to run into you again - it has been a while :-) Thanks for popping over on this one to take a look. I just signed the CLA so I think that part is good to go. Not immediately on fire but it would be a nice thing to fix since I suspect folks will start to run into this runtime crasher as adoption picks up (especially if they use SoLoader to init multiple native libs on different threads).

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot
Copy link

@passy has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@jbettcher
Copy link
Author

Hi @passy - any updates on this one? Looks like there are some internal checks that are failing. Let me know if there is anything I can do to help

@passy
Copy link
Member

passy commented Apr 25, 2022

@jbettcher Sorry, took a while to find a reviewer and was then on PTO. Is this still relevant with #99? Should we merge both?

@jbettcher
Copy link
Author

no worries! I think we can discard this one in favor of #99. We're testing that internally this week and it should address the root of the issue (multithreaded race condition in init() calls).

@passy
Copy link
Member

passy commented Apr 28, 2022

Sounds good. I'll close this for now but please reopen in case it becomes relevant again.

@passy passy closed this Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants