On 2-4-2017 15:23, Vlad Khorsun wrote:
> 02.04.2017 14:59, Mark Rotteveel wrote:
>> To come back to this again, there seems to be a concurrency bug in
>> events posted by Firebird to the client. It looks like it overwrites
>> local event ids (shared buffer, race condition?).
>>
>> This is triggered by running the entire Jaybird test suite. Running the
>> specific test, TestFBEventManager.testLargeMultiLoad, in isolation
>> significantly reduces the chance of it occurring.

[..]

>> Any thoughts or ideas on this, or is it better if I just create a bug
>> report?
>
>    Ideally, reproducible test case needed. As simple, as possible. Also, we
> could log every packet related to events on server side.

I have built a sample application that reproduces it a little bit more 
consistently (although it still occasionally succeeds without a 
mismatch). Note that this doesn't include the logging I showed in this 
conversation, let me know if you need that.

You can download it from 
https://www.dropbox.com/s/6jxfcadxtojodf8/event-race-condition-1.0-SNAPSHOT.zip?dl=0

Start with ./bin/event-race-condition --help for instructions. It 
requires Java 8.

Playing around with the --threadCount and --insertsPerThread can help to 
improve predictability to reproduce it. I used the same number of 
threads as I have (HT) cores in my machine. Using more inserts per 
thread can also increase the chance of it eventually occurring.

defaults are:
     private static String hostName = "localhost";
     private static int portNumber = 3050;
     private static String databasePath = "D:/data/db/fb3/eventrace.fdb";
     private static String user = "sysdba";
     private static String password = "masterkey";
     private static int threadCount = 8;
     private static int insertsPerThread = 200;

Full project: https://github.com/mrotteveel/event-race-condition

-- 
Mark Rotteveel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to