02.04.2017 18:07, Mark Rotteveel wrote:
> On 2-4-2017 16:48, Vlad Khorsun wrote:
...
>>    So, we have following packets exchange
>>
>> 1. op_que_event TEST_EVENT_A, cnt = 0xF5 (245), id = 0xD4 (212)
>> 2. op_event     TEST_EVENT_B, cnt = 0x7C (124), id = 0xD3 (211)
>> 3. op_que_event TEST_EVENT_B, cnt = 0x7C (124), id = 0xD5 (213)
>> 4. op_event     TEST_EVENT_A, cnt = 0xF7 (247), id = 0xD5 (213)
>> 5. op_que_event TEST_EVENT_B, cnt = 0xF7 (247), id = 0xD6 (214)
>> 6. op_event     TEST_EVENT_B, cnt = 0x7D (125), id = 0xD5 (213)
>>
>>    Packet 4 should contain id 212, agree. Looks like a server bug.
>>
>>    But how could you explain packet 5 which contains wrong count (247) ?
>> op_que_event packet is created by client, it should not be affected by
>> any server bug.
>
> That is because the current implementation in Jaybird only looks at the
> id, so when in step 4 it receives id 213 with count 247, it assumes that
> 247 is the new count for TEST_EVENT_B. It then re-queues that event with
> the updated count.
>
> This BTW is also what I believe the native implementation does: only
> looking at the id.

   Not sure i understand it. Does it means that events buffer, used at packet 4,
was reused to reque same event at packet 5 ? If yes, why event name was changed
by client while events count - doesn't ? If client looked at id when received
event and re-queued it again - why it changed event name ? I could understand
if client, when re-queued same event, leave received buffer as is...

   Also, i thought that test is multy threaded. Now it looks like sample above
was produced by single thread, correct ?

   Asking all that questions i want to be sure that there is no mistake at 
client
side when working with event buffers.

   As for what "native implementation does" - fbclient does nothing whith events
buffers, it just passed it between application and the server.

Regards,
Vlad

------------------------------------------------------------------------------
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