You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Alexander Shaklein (Jira)" <ji...@apache.org> on 2020/07/10 17:41:00 UTC

[jira] [Updated] (FELIX-6298) ipojo ServiceRegistry concurrency

     [ https://issues.apache.org/jira/browse/FELIX-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Shaklein updated FELIX-6298:
--------------------------------------
    Description: 
Hello.

During source code analyzing i've found some issues.

For example class org.apache.felix.ipojo.context.ServiceRegistry:
{code:java}
synchronized (m_regs) {            
   ServiceRegistrationImpl reg = new ServiceRegistrationImpl(this, instance, new String[] { clazz }, new Long(m_serviceId++), svcObj, dict); 
   m_regs.add(reg);            
   fireServiceChanged(new ServiceEvent(ServiceEvent.REGISTERED, reg.getReference()));            
   return reg;        
}
{code}
Is not good cause:
 * may result deadlock
 * too complex code in synchronized

So the question is - should i contribute some fixes in PR. Are you interested?

[https://github.com/apache/felix-dev/pull/34]

  was:
Hello.

During source code analyzing i've found some issues.

For example class org.apache.felix.ipojo.context.ServiceRegistry:
{code:java}
synchronized (m_regs) {            
   ServiceRegistrationImpl reg = new ServiceRegistrationImpl(this, instance, new String[] { clazz }, new Long(m_serviceId++), svcObj, dict); 
   m_regs.add(reg);            
   fireServiceChanged(new ServiceEvent(ServiceEvent.REGISTERED, reg.getReference()));            
   return reg;        
}
{code}
Is not good cause:
 * may result deadlock
 * too complex code in synchronized

So the question is - should i contribute some fixes in PR. Are you interested?


> ipojo ServiceRegistry concurrency
> ---------------------------------
>
>                 Key: FELIX-6298
>                 URL: https://issues.apache.org/jira/browse/FELIX-6298
>             Project: Felix
>          Issue Type: Bug
>            Reporter: Alexander Shaklein
>            Priority: Major
>
> Hello.
> During source code analyzing i've found some issues.
> For example class org.apache.felix.ipojo.context.ServiceRegistry:
> {code:java}
> synchronized (m_regs) {            
>    ServiceRegistrationImpl reg = new ServiceRegistrationImpl(this, instance, new String[] { clazz }, new Long(m_serviceId++), svcObj, dict); 
>    m_regs.add(reg);            
>    fireServiceChanged(new ServiceEvent(ServiceEvent.REGISTERED, reg.getReference()));            
>    return reg;        
> }
> {code}
> Is not good cause:
>  * may result deadlock
>  * too complex code in synchronized
> So the question is - should i contribute some fixes in PR. Are you interested?
> [https://github.com/apache/felix-dev/pull/34]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)