[Rd] [New Patch] Fix disk corruption when writing

Serguei Sokol sokol at insa-toulouse.fr
Mon Jul 10 11:34:19 CEST 2017


Le 10/07/2017 à 11:19, Duncan Murdoch a écrit :
> On 10/07/2017 4:54 AM, Serguei Sokol wrote:
>> Le 08/07/2017 à 00:54, Duncan Murdoch a écrit :
>>> I have now committed changes to R-devel (rev 72898) that seem to catch large and small errors.  They only give a warning if the error happens when the
>>> connection is closed, because that can happen asynchronously
>> For this asynchronous behavior, would not it be more useful to have
>> the name of the file that failed at closing? If many files were open
>> during a session and not closed explicitly (yes, bad practice but it
>> can happen), the warning message doesn't help to understand
>> which of files were corrupted, e.g.:
>>  > fc=file("/dev/full", "w")
>>  > write.csv("a", file=fc)
>>  > q("yes")
>> Warning message:
>> In close.connection(getConnection(set[i])) :
>>    Problem closing connection:  No space left on device
>>
>> Having only "set[i]" for indication is not very informative, is it?
>
> To debug your failure to close fc, reproduce the conditions before the warning was issued, and call showConnections().
It can help in some cases but in all.
First, to reproduce the exact condition of failure is not always possible. It could
happen after a long calculation and the environment that caused
the failure could evolve meantime. And second, having the list of
connections still does not say which one (or many) has/have failed as
we have only "set[i]" not even the connection number (which in turn
could be not the same between the first failure and a tentative to reproduce it).

Is adding con->description to the warning message problematic in any sens ?

Serguei.



More information about the R-devel mailing list