Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Font cache thread safety #5226

Copy link
Copy link
Closed
Closed
Copy link
@timj

Description

@timj
Issue body actions

The tests for the LSST software stack are run in parallel. We were getting failures roughly 10% of the time because of font cache directory creation issues. Looking at the code in font_manager.py we realised that setting $TRAVIS would fix our problem, which it did. This feels wrong though. It seems to me that this TRAVIS-specific bandaid is masking a more general problem with the cache. At the very least the environment variable being used to work around the problem should not be TRAVIS as the problem occurs any time two processes are trying to run matplotlib at the same time. Trying to explain why our test harness is forcing export TRAVIS=1 is challenging 😄

This is the trace without TRAVIS being set:

   import matplotlib.colorbar
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/colorbar.py", line 34, in <module>
    import matplotlib.collections as collections
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/collections.py", line 27, in <module>
    import matplotlib.backend_bases as backend_bases
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 56, in <module>
    import matplotlib.textpath as textpath
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/textpath.py", line 19, in <module>
    import matplotlib.font_manager as font_manager
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1415, in <module>
    _rebuild()
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1402, in _rebuild
    pickle_dump(fontManager, _fmcache)
  File "/home/vagrant/stack/Linux64/anaconda/2.2.0/lib/python2.7/site-packages/matplotlib/font_manager.py", line 952, in pickle_dump
    with open(filename, 'wb') as fh:
IOError: [Errno 2] No such file or directory: u'/tmp/matplotlib-vagrant/fontList.cache'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.