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 sandbox_rlimiter's logic for looking up its own filename. #630

Merged
merged 3 commits into from
Oct 21, 2013

Conversation

hodgestar
Copy link
Contributor

The sandbox rlimiter needs to exec a Python instance that runs itself as a script to avoid importing parts of Twisted that get unhappy when closing filehandles. Currently the script does something like python __file__ but __file__ may be a .pyc file. This is ordinarily fine but if the .py file has just been updated the .pyc file will be invalid and this will fail.

This manifests as an error fro the sandbox that looks like:

[2013-10-21T08:03:08.550038, ERROR] /ve/bin/python: can't open file '/ve/src/vumi/vumi/application/sandbox_rlimiter.pyc': [Errno 2] No such file or directory

The fix is to replace the .pyc or .pyo with .py.

@ghost ghost assigned hodgestar Oct 21, 2013
@hodgestar
Copy link
Contributor Author

Any idea how to test this?

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 9a4655e on feature/issue-630-fix-rlimiter-exec-filename into 8f3bfa0 on develop.

@jerith
Copy link
Member

jerith commented Oct 21, 2013

Maybe set script_name at module level and have a test that does some import trickery to make sure foo.__file__ is a .pyc and foo.script_name is a .py?

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling d4abe64 on feature/issue-630-fix-rlimiter-exec-filename into 8f3bfa0 on develop.

@jerith
Copy link
Member

jerith commented Oct 21, 2013

👍

@hodgestar hodgestar merged commit d4abe64 into develop Oct 21, 2013
@jerith jerith deleted the feature/issue-630-fix-rlimiter-exec-filename branch April 4, 2014 08:46
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

3 participants