[Zope-CMF] Re: [CMF] 84/ 2 Accept "Excessive time consumption by "Filesystem Directory View""
Dieter Maurer
dieter@handshake.de
Mon, 4 Nov 2002 20:46:58 +0100
Hi Chris,
Chris Withers writes:
> Dieter Maurer wrote:
> > > Checking only the modification time of directoreis doesn't always work as far as adding and deleting files is concerned.
> > Can you please be more specific.
> > Which tests fail and under what conditions, e.g. operating system.
>
> I'm afraid I can't rememeber. What I'd suggest is making any changes you see as
> appropriate and then run all the tests and check that they pass.
Sounds good!
The comment in "DirectoryInformation._changed" says that some Windows
directories do not update the directory modification time for
new/deleted files.
In this case, we cannot rely on modification time and must use
explicit scanning. "listdir" should be sufficient for this and
a bit less expensive than "walk".
> > Under Unix, I can only imagine two reasons why checking the modification
> > time does not produce reliable results:
> >
> > 1. the resolution (seconds) of the modification time is not enough
> > to check add/delete/modification reliably.
>
> The tests get around this by updating the file in a loop until the modification
> date changes. Some of the tests were failing even with this :-(
Hm, almost unbelievable.
Maybe, "_changed" is called and no reload called for despite "_changed"
returned 1. A single call to "_changed" resets the state.
As the "Directory Registry" and the contained "DirectoryInformation"
instances live in a module, there may be the danger of race
conditions.
On the other hand, I would not expect that a test, unless explicitly
designed to generate race conditions, should reveal one.
Lets see what tests fail.
I will then see whether I can reproduce it here and find out
the reason.
Dieter