Skip to content

HUP reloading does not get sys.path updates from .pth files. #402

@rduplain

Description

@rduplain

When HUP reloading, gunicorn does not reload updated packages which are installed into non-zip egg directories, when the updated package has a new version number. The installation looks something like:

site-packages/
├── easy-install.pth
├── SomePackage-v1.0-py2.7.egg
└── SomePackage-v1.1-py2.7.egg

If SomePackage-v1.1-py2.7.egg is added after the master gunicorn process loads and easy-install.pth is updated accordingly, the forked workers never see the change in sys.path.

This appears to be a limitation in how .pth files are loaded in site.py, which is done at the time the master gunicorn process loads. I asked about reliable reinitialization of sys.path including .pth files via site.py here:
http://mail.python.org/pipermail/distutils-sig/2012-September/018855.html

This is related to #394 such that symbolic linking would provide a solution.

My current workaround for package reloading is to sync the packages to a non-changing filepath (via rsync or git).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions