<br><br><div class="gmail_quote">On Thu, Apr 19, 2012 at 10:46 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I still don&#39;t quite understand how too many files could be open. But that&#39;s the error I saw at the VM level - and it only happens on Mac and Linux (which share the same file plugin code).<br></blockquote><div><br>
</div><div>Personally I don&#39;t like the <span class="Apple-style-span" style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">CurrentReadOnlySourceFiles cacheDuring: idiom because it forces too many clients to be aware.  Better is to make SourceFiles a self-contained object that maintains writeable and read-only files for sources and changes and have CompiledMethod ChangeRecord et al explicitly use the read-only files as appropriate.  I did this in Newspeak images and it worked well.</span></div>
<div><span class="Apple-style-span" style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><br></span></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span class="HOEnZb"><font color="#888888"><br>
- Bert -<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 19.04.2012, at 10:36, Nicolas Cellier wrote:<br>
<br>
&gt; Ah thanks, very useful.<br>
&gt; I noticed the bug, suspected the origin but didn&#39;t had time to correct.<br>
&gt;<br>
&gt; Nicolas<br>
&gt;<br>
&gt; Le 19 avril 2012 18:36,  &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; a écrit :<br>
&gt;&gt; Bert Freudenberg uploaded a new version of Monticello to project The Trunk:<br>
&gt;&gt; <a href="http://source.squeak.org/trunk/Monticello-bf.504.mcz" target="_blank">http://source.squeak.org/trunk/Monticello-bf.504.mcz</a><br>
&gt;&gt;<br>
&gt;&gt; ==================== Summary ====================<br>
&gt;&gt;<br>
&gt;&gt; Name: Monticello-bf.504<br>
&gt;&gt; Author: bf<br>
&gt;&gt; Time: 19 April 2012, 9:36:55.211 am<br>
&gt;&gt; UUID: 5fa1177d-b1ed-4cf0-8628-229f171ca814<br>
&gt;&gt; Ancestors: Monticello-eem.503<br>
&gt;&gt;<br>
&gt;&gt; Fix intermittant load problem. We sometimes would get a &#39;changes file not found&#39; in the middle of updating, but retrying found it just fine. I finally tracked it down to too many files being open. This change re-uses the same read-only copy during a package load (which additionally might speed up loading a tiny bit).<br>

&gt;&gt;<br>
&gt;&gt; =============== Diff against Monticello-eem.503 ===============<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;  ----- Method: MCPackageLoader&gt;&gt;basicLoad (in category &#39;private&#39;) -----<br>
&gt;&gt;  basicLoad<br>
&gt;&gt;        &quot;Load the contents of some package. This is the core loading method<br>
&gt;&gt;        in Monticello. Be wary about modifying it unless you understand the details<br>
&gt;&gt;        and dependencies of the various entities being modified.&quot;<br>
&gt;&gt;        | pkgName |<br>
&gt;&gt;        errorDefinitions := OrderedCollection new.<br>
&gt;&gt;        &quot;Obviously this isn&#39;t the package name but we don&#39;t have anything else<br>
&gt;&gt;        to use here. ChangeSet current name will generally work since a CS is<br>
&gt;&gt;        usually installed prior to installation.&quot;<br>
&gt;&gt;        pkgName := ChangeSet current name.<br>
&gt;&gt;<br>
&gt;&gt; +       [CurrentReadOnlySourceFiles cacheDuring: [[<br>
&gt;&gt; +       &quot;Pass 1: Load everything but the methods,  which are collected in methodAdditions.&quot;<br>
&gt;&gt; -       [[&quot;Pass 1: Load everything but the methods,  which are collected in methodAdditions.&quot;<br>
&gt;&gt;        additions do: [:ea |<br>
&gt;&gt;                ea isMethodDefinition<br>
&gt;&gt;                        ifTrue:[methodAdditions add: ea asMethodAddition]<br>
&gt;&gt;                        ifFalse:[[ea load]on: Error do: [errorDefinitions add: ea]].<br>
&gt;&gt;        ] displayingProgress: &#39;Reshaping &#39;, pkgName.<br>
&gt;&gt;<br>
&gt;&gt;        &quot;Try again any delayed definitions&quot;<br>
&gt;&gt;        self shouldWarnAboutErrors ifTrue: [self warnAboutErrors].<br>
&gt;&gt;        errorDefinitions do: [:ea | ea load]<br>
&gt;&gt;                displayingProgress: &#39;Reloading &#39;, pkgName.<br>
&gt;&gt;<br>
&gt;&gt;        &quot;Pass 2: We compile new / changed methods&quot;<br>
&gt;&gt;        methodAdditions do:[:ea| ea createCompiledMethod]<br>
&gt;&gt;                displayingProgress: &#39;Compiling &#39;, pkgName.<br>
&gt;&gt;<br>
&gt;&gt;        &#39;Installing &#39;, pkgName displayProgressFrom: 0 to: 2 during:[:bar|<br>
&gt;&gt;                &quot;There is no progress *during* installation since a progress bar update<br>
&gt;&gt;                will redraw the world and potentially call methods that we&#39;re just trying to install.&quot;<br>
&gt;&gt;                bar value: 1.<br>
&gt;&gt;<br>
&gt;&gt;                &quot;Pass 3: Install the new / changed methods<br>
&gt;&gt;                (this is a separate pass to allow compiler changes to be loaded)&quot;<br>
&gt;&gt;                methodAdditions do:[:ea| ea installMethod].<br>
&gt;&gt;<br>
&gt;&gt;                &quot;Pass 4: Remove the obsolete methods&quot;<br>
&gt;&gt;                removals do:[:ea| ea unload].<br>
&gt;&gt;        ].<br>
&gt;&gt;<br>
&gt;&gt;        &quot;Finally, notify observers for the method additions&quot;<br>
&gt;&gt;        methodAdditions do: [:each | each notifyObservers]<br>
&gt;&gt;                &quot;the message is fake but actually telling people how much time we spend<br>
&gt;&gt;                in the notifications is embarrassing so lie instead&quot;<br>
&gt;&gt;                displayingProgress: &#39;Installing &#39;, pkgName.<br>
&gt;&gt;<br>
&gt;&gt;        additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)]<br>
&gt;&gt;                displayingProgress: &#39;Initializing &#39;, pkgName.<br>
&gt;&gt;<br>
&gt;&gt;        ] on: InMidstOfFileinNotification do: [:n | n resume: true]<br>
&gt;&gt; +       ]] ensure: [self flushChangesFile]!<br>
&gt;&gt; -       ] ensure: [self flushChangesFile]!<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
<br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>