There's a patchbot problem on #8327 that needs more eyeballs (or at
least Robert's eyeballs):

The patchbot there sporadically fails on various tests with errors of
the type

Traceback (most recent call last):
  File "/mnt/storage2TB/patchbot/.sage/tmp/
volker_desktop.stp.dias.ie-14095/multireplace_29004.py", line 6, in
<module>
    from sage.all_cmdline import *;
  File "/mnt/storage2TB/patchbot/Sage/sage-5.5.rc0/local/lib/python/
site-packages/sage/all_cmdline.py", line 14, in <module>
    from sage.all import *
  File "/mnt/storage2TB/patchbot/Sage/sage-5.5.rc0/local/lib/python/
site-packages/sage/all.py", line 72, in <module>
    from sage.rings.all      import *
  File "/mnt/storage2TB/patchbot/Sage/sage-5.5.rc0/local/lib/python/
site-packages/sage/rings/all.py", line 169, in <module>
    lazy_import("sage.rings.universal_cyclotomic_field.all","*")
  File "lazy_import.pyx", line 850, in
sage.misc.lazy_import.lazy_import (sage/misc/lazy_import.c:5168)
    names[ix:ix+1] = get_star_imports(module)
  File "lazy_import.pyx", line 900, in
sage.misc.lazy_import.get_star_imports (sage/misc/lazy_import.c:5924)
    star_imports = pickle.load(open(cache_file))
EOFError

The code in question:

{{{
    if star_imports is None:
        cache_file = get_cache_file()
        if os.path.exists(cache_file):
            star_imports = pickle.load(open(cache_file))
        else:
            star_imports = {}
}}}

The error seems to indicate that the cache file either gets corrupted
or that
between the path.exists and the open, the file gets truncated or
deleted.

The code that writes the cache file seems careful: It writes the file
to a tmp
and then moves it into place. That should be atomic. However, it does
seem that
the *same* cache file is used by all parallel doctest instances, so
there seems
plenty of room for race conditions that would be more likely to get
triggered on
a ticket that uses star_imports (as this one does). Would:

{{{
    if star_imports is None:
        cache_file = get_cache_file()
        try:
            star_imports = pickle.load(open(cache_file))
        except IOError:
            star_imports = {}
}}}

be a more robust alternative?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to