Opened 8 years ago
Closed 8 years ago
#11818 closed defect (fixed)
sage <script> does not run sagecleaner
Reported by:  vbraun  Owned by:  

Priority:  major  Milestone:  sage4.7.2 
Component:  scripts  Keywords:  
Cc:  Merged in:  sage4.7.2.alpha3  
Authors:  John Palmieri  Reviewers:  Volker Braun 
Report Upstream:  N/A  Work issues:  
Branch:  Commit:  
Dependencies:  Stopgaps: 
Description (last modified by )
When you are running a long computation, you are probably putting your sage program in a script.sage
file and then run sage script.sage
in a screen'ed terminal. In that case, sagecleaner
is not run. So if you use @parallel, each fork creates a new subdirectory $DOT_SAGE/temp/hostname/pid
that is not being cleaned up. This can easily reach a limit of the file system, for example ext2/ext3 are limited to 2^{15} subdirectories per directory.
A typical error message then looks like
[Errno 31] Too many links: '/home/vbraun/.sage//temp/hostname/26457/'
Apply trac_11818_run_sage_setup.patch to the sagescripts repository ($SAGE_LOCAL/bin)
Attachments (2)
Change History (16)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Is a change like this good enough?

sagesage
diff git a/sagesage b/sagesage
a b if [ $# ge 1 ]; then 1021 1021 exit $? 1022 1022 fi 1023 1023 cd "$SAGE_LOCAL/bin/" 1024 SAGE_BANNER="no" sage_setup 1024 1025 sagerun "$CUR" "$@" 1025 1026 exit $? 1026 1027 fi
comment:4 Changed 8 years ago by
 Reviewers set to Volker Braun
 Status changed from needs_review to positive_review
I am giving this positive review :)
comment:5 Changed 8 years ago by
 Description modified (diff)
comment:6 Changed 8 years ago by
 Description modified (diff)
comment:7 Changed 8 years ago by
I'll see if I can include this patch bomb into Sage 4.7.2.alpha3...
comment:8 followup: ↓ 10 Changed 8 years ago by
P.S.:
Some doctest in sage/parallel/*
analoguous to what Volker did wouldn't be bad.
comment:9 Changed 8 years ago by
But during parallel doctests there should be a large and fluctuating number of directories in the temp dir. So I don't see an easy way of testing this...
comment:10 in reply to: ↑ 8 Changed 8 years ago by
Replying to leif:
P.S.:
Some doctest in
sage/parallel/*
analoguous to what Volker did wouldn't be bad.
... which perhaps isn't that easy.
comment:11 Changed 8 years ago by
I had an idea how to doctest this, but it passes doctests regardless of whether the patch here has been applied. I'll post it here in case you have any suggestions.
comment:12 followup: ↓ 13 Changed 8 years ago by
When you are doctesting this, the sagecleaner was already started by the doctesting process. In a singlethreaded doctest you could kill the sagecleaner and check that it is being restarted, but with parallel testing that would just be a race condition.
comment:13 in reply to: ↑ 12 Changed 8 years ago by
Replying to vbraun:
When you are doctesting this, the sagecleaner was already started by the doctesting process.
Right, I was just coming to the same conclusion, although I'm not sure where sagecleaner is actually started when you run "sage t FILE".
In any case, it looks difficult, or at least annoying, to test this from within Sage's doctesting framework.
comment:14 Changed 8 years ago by
 Merged in set to sage4.7.2.alpha3
 Resolution set to fixed
 Status changed from positive_review to closed
Steps to reproduce: