felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eduard Vodicka (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-5086) Coordinator.begin can return null
Date Fri, 23 Oct 2015 07:24:27 GMT

    [ https://issues.apache.org/jira/browse/FELIX-5086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14970578#comment-14970578

Eduard Vodicka commented on FELIX-5086:

A workaround that keeps a strong reference to the CoordinationHolder as long as it is not
passed to the client solves the problem. A possible solution is demonstrated in the attached

> Coordinator.begin can return null
> ---------------------------------
>                 Key: FELIX-5086
>                 URL: https://issues.apache.org/jira/browse/FELIX-5086
>             Project: Felix
>          Issue Type: Bug
>          Components: Coordinator Service
>    Affects Versions: coordinator-1.0.0
>            Reporter: Eduard Vodicka
>            Priority: Critical
>         Attachments: Fix_null_return.patch, test_to_demonstrate_GC_problems.patch
> Calls to CoordinatorImpl.begin (and CorrdinatorImpl.create) can return null, if the Garbage
Collector runs between the creation of the Coordination and the return of the CoordinationHolder
> During that time, only the WeakReference to the Holder exists, therefor it is removed
and cannot be returned to the caller.
> This can easily happen in high load scenarios with many calls to CoordinatorImpl.begin.
The caller has no chance of ever receiving a Coordination reference.
> I created a simple test do demonstrate the problem.

This message was sent by Atlassian JIRA

View raw message