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

obs_base don't create calib repo if it does not exist #25

Merged
merged 1 commit into from
Mar 18, 2017

Commits on Mar 18, 2017

  1. don't create calib repo if it does not exist

    The problem is that "old" butler init API is translated to "new" butler API to
    create an output repository with mode = 'rw'. The result is that butler will
    create the storage (directory, in the case of a posix repository) if the
    directory does not exist. CameraMapper has both a 'root' repo and a 'calib'
    repo, so there are 2 storages associated with it.
    
    This was causing a race condition in obs_subaru: tests in multiple files are
    using the mapper with root=".", and they are only reading (I hope) from the
    mapper.
    But for these tests the calib repo does not exist on disk and is not required
    for the test. But HscMapper (CameraMapper subclass) will init CameraMapper with
    calibRoot='CALIB' if no other calibRoot is specified.
    So CameraMapper was causing Storage to create the calib storage folder, and
    when multiple tests were running this exposed a race condition where two tests
    could be calling makedirs at the same time.
    This fix causes CameraMapper to not create a CALIB folder if the storage does
    not exist, which is fine: CameraMapper does not write to the CALIB folder.
    The totally correct fix would be for CameraMapper subclasses to not pass in a
    calibRoot if they don't expect it to exist.
    Also, in daf_persistence, makedirs was changed to safeMakeDir, which would
    prevent the crash but would allow the tests to leave CALIB folders sprinkled
    around which would not be good.
    Nate Pease committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    e30d6a6 View commit details
    Browse the repository at this point in the history