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

Fixing untrustable os.path.exists #175

Merged
merged 1 commit into from
Oct 28, 2017
Merged

Conversation

karolyi
Copy link
Contributor

@karolyi karolyi commented Oct 27, 2017

As per https://stackoverflow.com/a/3112717/1067833,
os.path.exists sometimes delivers a wrong value. These are corner
cases, but mine is exactly one:

I run xapian-haystack in a multiprocess environment (indexing and
django server), on an LXC container, which has its mount probably
mounted from an NFS server (I have no control/information over it).

This corner case results the os.path.exists give True for one
process and False for another, resulting in the exception I
handle with this patch.

As per https://stackoverflow.com/a/3112717/1067833,
os.path.exists sometimes delivers a wrong value. These are corner
cases, but mine is exactly one:

I run xapian-haystack in a multiprocess environment (indexing and
django server), on an LXC container, which has its mount probably
mounted from an NFS server (I have no control/information over it).

This corner case results the os.path.exists give `True` for one
process and `False` for another, resulting in the exception I
handle with this patch.
@coveralls
Copy link

coveralls commented Oct 27, 2017

Coverage Status

Coverage remained the same at 99.563% when pulling ffc1152 on karolyi:master into 253c4c2 on notanumber:master.

@karolyi
Copy link
Contributor Author

karolyi commented Oct 27, 2017

@notanumber, please merge this asap.

@notanumber
Copy link
Owner

Hey @karolyi I'm not actually the maintainer of this repo anymore, haven't been for many years in fact. You're looking for @jorgecarleitao

At a glance, the commit seems good to me and all the tests still pass. Lets give @jorgecarleitao a bit to respond and if we don't hear from him I'll merge it.

@karolyi
Copy link
Contributor Author

karolyi commented Oct 27, 2017

aight, thx. @jorgecarleitao, waiting for you eagerly.

@jorgecarleitao jorgecarleitao merged commit 3c322a9 into notanumber:master Oct 28, 2017
@jorgecarleitao
Copy link
Collaborator

That indeed makes sense. Thanks @karolyi for the PR!

@karolyi
Copy link
Contributor Author

karolyi commented Oct 28, 2017

great stuff. can you please create an actual release out of this? I'd like to deploy it into my environments.

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

Successfully merging this pull request may close these issues.

None yet

4 participants