jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikas Saurabh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-7646) UploadStagingCacheTest#testConcurrentSameAddRequest fails intermittently
Date Fri, 20 Jul 2018 16:41:00 GMT

    [ https://issues.apache.org/jira/browse/OAK-7646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16550969#comment-16550969
] 

Vikas Saurabh commented on OAK-7646:
------------------------------------

I tried the test and it ran fine a few times (but intermittent :-/).
bq. The issue is some sort of a race condition when using MeterStats which is backed by LongAdder
and should not happen.
I think that's not true at least in tests. I was debugging through the test and {{SimpleStats}}
(OAK-3283) is being used as impl for {{MeterStats}}.

bq. Curiously using mark(1) seems to work reliably for me.
I think the issue as [~chetanm] has thankfully noted in {{SimpleStats}} is:
{quote}
    /*
        Using 2 different variables for managing the sum in meter calls
        1. Primitive variant is used for just increment
        2. AtomicLong variant is used for increment by 'n'

        This is done to ensure that more frequent mark() is fast (used for Session reads)
        and overhead of AtomicLong is used only for less critical flows

        Once we move to JDK 8 we can probably use LongAdder from that has lesser
        impact on performance
     */
{quote}

.... and since, at least in trunk (1.8??) we have jdk8, maybe we can go to a single {{LongAdder}}
based {{SimpleStats}} (fwiw, JDK8 LongAdder already exists in guava... and was contributed
to Jdk \[0]... so, if required, we can probably backport using guava's LongAdder... not sure
of the wisdom though)

\[0]: https://github.com/google/guava/blob/master/guava/src/com/google/common/cache/LongAdder.java

> UploadStagingCacheTest#testConcurrentSameAddRequest fails intermittently
> ------------------------------------------------------------------------
>
>                 Key: OAK-7646
>                 URL: https://issues.apache.org/jira/browse/OAK-7646
>             Project: Jackrabbit Oak
>          Issue Type: Test
>          Components: blob-plugins
>            Reporter: Vikas Saurabh
>            Assignee: Amit Jain
>            Priority: Minor
>
> As noted on VOTE mail thread for 1.9.6 \[0], {{UploadStagingCacheTest#testConcurrentSameAddRequest}}
fails intermittently as:
> {noformat}
> [INFO] Running org.apache.jackrabbit.oak.plugins.blob.UploadStagingCacheTest
> [ERROR] Tests run: 22, Failures: 1, Errors: 0, Skipped: 0, Time
> elapsed: 15.595 s <<< FAILURE! - in
> org.apache.jackrabbit.oak.plugins.blob.UploadStagingCacheTest
> [ERROR] testConcurrentSameAddRequest(org.apache.jackrabbit.oak.plugins.blob.UploadStagingCacheTest)
>  Time elapsed: 0.214 s  <<< FAILURE!
> java.lang.AssertionError: expected:<2> but was:<1>
>         at org.apache.jackrabbit.oak.plugins.blob.UploadStagingCacheTest.assertCacheStats(UploadStagingCacheTest.java:843)
>         at org.apache.jackrabbit.oak.plugins.blob.UploadStagingCacheTest.testConcurrentSameAddRequest(UploadStagingCacheTest.java:456)
> [INFO]
> [INFO] Results:
> [INFO]
> [ERROR] Failures:
> [ERROR]   UploadStagingCacheTest.testConcurrentSameAddRequest:456->assertCacheStats:843
> expected:<2> but was:<1>
> [INFO]
> [ERROR] Tests run: 179, Failures: 1, Errors: 0, Skipped: 0
> [INFO]
> [INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Oak Parent POM ..................................... SUCCESS
> [01:22 min]
> ....
> ....
> [INFO] Oak Blob Plugins ................................... FAILURE [
> 38.111 s]
> [INFO] Oak Core ........................................... SKIPPED
> ....
> ....
> [INFO] Jackrabbit Oak ..................................... SKIPPED
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> {noformat}
> [~amjain], should I assign it to you?
> \[0]: https://lists.apache.org/thread.html/42e50349cd7e559f0b579093e56e421e6127a2fdec563debc393fcdd@%3Coak-dev.jackrabbit.apache.org%3E



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message