syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SYNCOPE-1448) Bean loading/register section not threadsafe
Date Mon, 18 Mar 2019 07:04:00 GMT

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

ASF subversion and git services commented on SYNCOPE-1448:
----------------------------------------------------------

Commit 44bf731faea371d0439286386b453d38b80c6832 in syncope's branch refs/heads/SYNCOPE-1448_alternative-fix
from Francesco Chicchiriccò
[ https://gitbox.apache.org/repos/asf?p=syncope.git;h=44bf731 ]

[SYNCOPE-1448] Relying on Spring's concurrency checks


> Bean loading/register section not threadsafe
> --------------------------------------------
>
>                 Key: SYNCOPE-1448
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-1448
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.1.3
>            Reporter: longstone
>            Assignee: Francesco Chicchiriccò
>            Priority: Major
>             Fix For: 2.1.4, 3.0.0
>
>
> Issue:
> When two threads (T1,T2) arrive the section {{if (ApplicationContextProvider.getBeanFactory().containsSingleton(ruleClass.getName()))
{}}at the same time they will both assume that there is no bean, which is right so far.
> T1 register the bean as it should here {{ApplicationContextProvider.getBeanFactory().registerSingleton(ruleClass.getName(),
rule);}}. As soon as T2does the same, an exception is thrown.
> Solution:
> When T1 and T2 found that a given bean is not there, they'll hit a synchronized section
with double checking. This will prevent the duplicated creation and registration of a bean.



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

Mime
View raw message