Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!agate!library.ucla.edu!csulb.edu!csus.edu!netcom.com!lovejoya
From: lovejoya@netcom.com (Alan Lovejoy)
Subject: Re: ObjectWorks handling disk-full errors
Message-ID: <lovejoyaD2FtJI.BGL@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <D2Eqz3.FGF@dcs.gla.ac.uk> <khaw.790122218@parcplace.com>
Date: Sun, 15 Jan 1995 08:14:06 GMT
Lines: 47

khaw@parcplace.com wrote:
>In <D2Eqz3.FGF@dcs.gla.ac.uk> aran@dcs.gla.ac.uk (Aran Lunzer) writes:

>>Hi - please could someone tell me whether there is a fix for this:

>>Running ObjectWorks 4.1 on Unix, with my file space on a shared disk, 
>>there are inevitably times when the disk momentarily becomes full.  
>>If Smalltalk happens to be writing a file at this point, a "No space 
>>left on device" error is raised.

>>The problem is that even if I abandon the operation, clear plenty of
>>disk space and try again, Smalltalk fails to recognise that there is
>>now space to proceed.  It seems that as soon as a disk accessor encounters
>>a "no space" condition it becomes completely and permanently unusable.
>>This is a serious bummer when the accessor in question is the one that
>>handles the image or change file.

>The file descriptor for the image file, once broken because of an
>ENOSPC error, continues to fail all subsequent i/o with ENOSPC until
>the (heavyweight Unix) process exits. This is how the OS treats the file
>descriptor, not anything that Smalltalk is doing.

>One possibility is to, ***without quitting the error notifier***, start
>another image save. This should probably cause the new attempt to get a
>new file descriptor on the image file to be written.
>--
>Michael Khaw	khaw@parcplace.com (or khaw%parcplace.com@netcom.com)
>ParcPlace Systems, Sunnyvale, CA	PRODUCT INFO: info@parcplace.com

In Objectworks 2.5, I found a fix  for this:

OSErrorHolder volumeFullSignal
	handle: [:ex | UserError confirmVolumeFull. ex restart]
	do: [..<operation that writes a file>..]

One could not put such error handlers just anywhere--they had to go in
certain specific locations in the IOAccessor methods and in the image save
method so that the context would be in the right state on restart.  

Unfortunately, this stopped working in ObjectWorks 4.x.  I haven't tried it
in VisualWorks 2.0 yet. 
			
-- 
--
Alan Lovejoy | INTERNET: lovejoya@netcom.com | Smalltalk-80 Consultant
"Do not go gentle into that good night. Old age should burn and rave 
at the closing of the day.  Rage, rage at the dying of the light!"
