On 06/ 8/10 10:13 AM, [email protected] wrote:
On Mon, Jun 07, 2010 at 09:11:29PM -0700, Shawn Walker wrote:
On 06/ 7/10 07:11 PM, [email protected] wrote:
General question:

- Is there a test-suite module for the file manager?  If so, can you add
   a test?  If not, can you file a bug to create such a module for the
   test suite?

There's a test suite module under tests/api/t_file_manager.py.

Since this test is timing sensitive (it would require two separate
processes or threads both trying to insert a file into a
file_manager directory at the same time), I wasn't certain if adding
something to the existing test suite was valuable or practical,
although I can certainly try.

Ah, it somehow didn't click that this was a race condition.  From the
existing code, it looked like it might be possible to get this exception
by inserting one file, and then inserting another.  If this is timing
related and not an ordering issue, then don't worry about it.

The race is in the case where the parent directory for the file doesn't already exist at the point of insertion. So two or more competing processes or threads who all believe that the parent directory doesn't exist will try to create the parent directory(s) at the same time leading to the error.

In the case of file_manager, realistically, I'm only ever expecting the immediate parent directory ('00/', 'ff/', etc.) to be the case where this error is encountered since the file root itself should already exist.

Cheers,
-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to