Possible race condition in gluon.admin.create_missing_folders

36 views
Skip to first unread message

Anthony

unread,
Sep 11, 2016, 10:01:07 AM9/11/16
to web2py-developers
I encountered an interesting problem when the Travis-CI build ran after I pushed a commit to the TechEmpower FrameworkBenchmarks repo. In gluon.admin.create_missing_folders, each of two Meinheld workers generated a File exists: '.../web2py/deposit' error. The relevant code is:

            if not os.path.exists(path):
                os
.mkdir(path)

I've run the tests many times via the VM with no problem, and I immediately re-ran the Travis-CI build and it passed, so I'm assuming this was a (hopefully rare) race condition, with both workers attempting to create the /deposit directory after confirming it does not exist.

Perhaps we should instead wrap os.mkdir in a try/except. Would probably need to do the same thing in create_missing_app_folders (and maybe in some other places).

Thoughts?

If we push a commit to fix this, I can update the benchmarking setup code to point to the latest commit so we don't run into this problem when they run the real tests.

Anthony

Anthony

unread,
Sep 13, 2016, 11:53:08 AM9/13/16
to web2py-developers
I went ahead and made a pull request: https://github.com/web2py/web2py/pull/1448
Reply all
Reply to author
Forward
0 new messages