db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kalén <martin.ka...@curalia.se>
Subject Re: Lock Failure on Postgresql
Date Tue, 22 Jun 2004 01:06:58 GMT
Robert S. Sfeir wrote:

> Looks like postgres is exhibiting the same symptoms as Oracle.  It looks
> like the test thinks someone else modified an object and can't get a lock
> and the test fails, either that or there is serious thread locking going on
> here.
> 
> org.apache.ojb.odmg.LockingMultithreadedTest$LockObjectRef@2fcbd8 for WRITE
> [DEFAULT] WARN: ### thread 3 waits 71 times. Maximal attempts are 100

I have seen this as non-deterministic (because of not 100% reproducable) behaviour
on Oracle9i and had a look at the LockingMultithreadedTest for ODMG.

It is a regression test with an inherit timing issue in the assertion;
a bit shaky for a JUnit test if you ask me. ;-)

If your machine has a lot to think about while running the JUnit tests
(or your remote RDBMS server is very busy) -- LockingMultithreadedTest will fail.


You can change the "int threads = 6" parameter to "int threads = 60" to get
an almost certain 100% reproducable test-case failure...


IMO it's not good enough to just add more discrete steps to the "maxAttemps"
parameter that cause the test to fail. Another machine running the tests
will (according to Murphy's law) be busy enough to make it fail anyway.

Same goes for converting discrete int step counting to long/timestamps and
checking delta times spent trying to aquire locks. This will still lead to
a regression test with a race-condition.


I think someone should take a look at refactoring LockingMultithreadedTest
a bit so that it uses a more deterministic rule for determining test failure.

The way it is now, people might think ODMG is shaky when it is in fact only
the test case.

Regards,
  Martin

-- 
Martin Kalén
Curalia AB              Web:  http://www.curalia.se
Orrspelsvägen 2B        Mail: info@curalia.se
SE-182 79  Stocksund    Tel:  +46-8-410 064 40

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message