This is the mail archive of the mauve-discuss@sources.redhat.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gnu/testlet/java/nio/channels/FileChannel/manyopen.java broken


Hi,

On Fri, 2004-10-08 at 08:47, Stephen Crawley wrote:
> noa@resare.com said:
> > Since the test doesn't actually test for anything other than the
> > ability to open many files and the extent of that ability isn't
> > specified in any spec that I'm aware of I suggest that we remove the
> > test. 
> 
> Agreed.  It should be deleted.
> 
> This testcase previously used to also (indirectly) check that orphaned file
> handles were closed by garbage collection finalization.  However, this
> was done by explicitly calling System.gc(), and thus was even more broken
> that the current version of the testcase.

As the person that wrote this test let me explain why I wrote it and
what I think should be tested.

We had a problem with real programs that open lots of files quickly
(gjdoc does this for example, a jar tool or a webserver might be another
good example) and don't explicitly close these files, but let the
file/stream just get garbage collected since the program structure
doesn't explicitly define a "owner" for the file/stream object (which
isn't that uncommon since that is what you normally do with random
allocated objects, long life the garbage collector!).

What I think should be tested is whether a program can open lots of
files. And that the systems notices that stale file handle resources can
be removed so that a program can keep opening files if needed. (As long
as there are no large number of life file handles open at the same
time.)

Since I have seen multiple systems get this wrong in various ways I want
to have an explicit test for this situation. It might be that this test
does not simulate a real world program correctly, so if there are
alternatives I would like to hear them instead of just deleting the test
since some systems fail it.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]