From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [patch] race condition in org-babel R Date: Fri, 20 May 2011 13:37:39 -0700 Message-ID: References: <87sjs9wrbf.fsf@cantab.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNWSL-0000od-BM for emacs-orgmode@gnu.org; Fri, 20 May 2011 16:37:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNWSK-00034v-20 for emacs-orgmode@gnu.org; Fri, 20 May 2011 16:37:57 -0400 Received: from lo.gmane.org ([80.91.229.12]:43489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNWSJ-00034W-PI for emacs-orgmode@gnu.org; Fri, 20 May 2011 16:37:55 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QNWSH-0003Jv-I7 for emacs-orgmode@gnu.org; Fri, 20 May 2011 22:37:53 +0200 Received: from c-76-126-252-88.hsd1.ca.comcast.net ([76.126.252.88]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 May 2011 22:37:53 +0200 Received: from dandavison7 by c-76-126-252-88.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 May 2011 22:37:53 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Christophe Rhodes writes: > Hi, > > A substantial fraction of times when exporting my org-babel document > (with many R session code blocks), I get "code block produced no > value". I think this is because of a race condition between > waiting for the transfer.file to exist and actually populating it with > output; the scenario is: 1. write.table() creates its output file > 2. emacs notices its existence, and reads it 3. write.table() gets round > to writing .Last.value to the file. > > The attached patch has made exporting much more reliable for me. Thanks, I agree that the race condition seems plausible, and I've applied a slight modification of your patch (the initial evaluation of the "object" argument looks pointless, but was there to ensure that errors in user code are not smothered by the subsequent exception handling.) Dan > > > > Best, > > Christophe