[ 
https://issues.apache.org/jira/browse/DERBY-4849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922556#action_12922556
 ] 

Knut Anders Hatlen commented on DERBY-4849:
-------------------------------------------

Thanks Kristian. The fix looks good to me. I also ran the test six times 
without the fix, and it failed twice.

There's one small issue with the test that I think could lead to intermittent 
failures. The main JUnit thread runs a wait loop while the helper threads are 
running, but when it terminates the loop and checks if everything went well, it 
doesn't really know that the helper threads have completed. If they haven't 
(for example because one of them used a little longer than expected to start 
up, or used a little longer in one of the iterations), the asserts in the test 
may fail.

I added Thread.sleep(1500) at the beginning of MTSimpleSelect.run() to test 
this, and then I got a mismatch in the final assertSingleValueResultSet() -- 
expected: >277<, found: >278<. I think we can avoid this problem by calling 
Thread.join() on the two helper threads instead of running the wait loop.

> Re-compilation may cause duplicate entries in the XPLAIN table
> --------------------------------------------------------------
>
>                 Key: DERBY-4849
>                 URL: https://issues.apache.org/jira/browse/DERBY-4849
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.6.2.1, 10.7.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-4849-1a-narrow_fix.diff, 
> derby-4849-2a-broad_fix.diff, derby-4849-2b-broad_fix_with_test.diff, 
> derby-4849-2b-broad_fix_with_test.stat, 
> derby-4849-xplain_duplicate_stacktrace.txt
>
>
> If happening at the right moment, a re-compilation request may cause 
> duplicate entries in the XPLAIN statement tables.
> I have only confirmed this for the SYSXPLAIN_STATEMENTS table, and I do not 
> know if the other XPLAIN tables are affected.
> The error is highly intermittent, and so far I have only been able to trigger 
> it when testing the automatic index statistics update prototype.
> See the attached stack-trace for some more details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to