[ESS] tracebug ess-inject-source race condition

Vitalie Spinu spinuvit at gmail.com
Wed Jun 26 11:22:42 CEST 2013

 >> Martin Maechler <maechler at stat.math.ethz.ch>
 >> on Wed, 26 Jun 2013 09:43:11 +0200 wrote:

 >>>>>> Vitalie Spinu <spinuvit at gmail.com>
 >>>>>> on Mon, 24 Jun 2013 03:25:47 +0200 writes:

 >> Thanks for reporting this. 

 >> I guess the only reliable solution is to not delete temp files at
 >> all. Or at least do the cleaning only on the process termination. 

 >> Vitalie

 > We definitely should keep a clean up procedure.
 > "on process termination" would be nice, but could that really
 > happen reliably?

We can use kill-buffer-hook for that. But that is somewhat unreliable.

 > A well working alternative might be to clean up files which must be
 > named in our "file pattern" if they are older than one week or
 > so. {may harm people who run an ESS for longer than one week, but
 > should they really be doing that ??}

Indeed, this looks like a pretty reliable option, I hope it is also

Another option is to make R to delete the file after sourcing it. I know
how to implement this reliably in R but not in other ESS dialects. So
emacs side solution is desirable anyways.


 >>>> Peter Meilstrup <peter.meilstrup at gmail.com>
 >>>> on Sun, 23 Jun 2013 14:41:20 -0700 wrote:

 >>> Here's a problem with how tracebug evaluates code chunks.
 >>> (1) set ess-inject-source to t

 >>> (2) Create an .R file with some code chunks that take an appreciable time
 >>> to evaluate. Then send a series of chunks using C-c -C-c (or faster: C-c
 >>> C-c, C-x C-z, z, z, z, z, z). The point is that ESS is sending chunks
 >>> faster than the R process runs them.

 >>> This results in ESS deleting temporary files before R can see them,
 >>> resulting in errors like:

 >>>> Error in file(filename, "r", encoding = encoding) :
 >>> cannot open the connection
 >>> In addition: Warning message:
 >>> In file(filename, "r", encoding = encoding) :
 >>> cannot open file
 >>> '/var/folders/Zz/ZzJ1nC8pHNGtZb-btS+lGU+++Tc/-Tmp-/ESS-region/bdd.R at 241':
 >>> No such file or directory

 >>> [[alternative HTML version deleted]]

 >>> ______________________________________________
 >>> ESS-help at r-project.org mailing list
 >>> https://stat.ethz.ch/mailman/listinfo/ess-help

 >> ______________________________________________
 >> ESS-help at r-project.org mailing list
 >> https://stat.ethz.ch/mailman/listinfo/ess-help

More information about the ESS-help mailing list