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

Mathieu Lirzin commented on OFBIZ-10638:
----------------------------------------

I am trying to preserve previous behavior. :-)

An atomic reference on the server state ensures atomicity of mutation of that 
reference only, but can't ensure the coordination of multiple thread safe 
mutations. To achieve that you need an extra synchronization layer, which in 
some case make the individual atomicity mechanism redundant.

In the above snippet both the loader and the server state are thread safe 
references on their own, but without a synchronized block (or another 
synchronization mechanism) you can't ensure for example that loading will be 
done only when the server state is either STARTING or RUNNING which was a 
concurrency warranty of the initial implementation.

I noticed potential concurrency issues in the initial implementation (the major 
one being that the invariants that should be preserved are not clearly 
documented) and to be honest I am currently working on that in parallel. 
However my strategy for this ticket is to consider the removal of the 
{{StartupLoader}} interface in isolation. Meaning I want to postpone 
fixing/improving prior concurrency issue to another ticket. I only want to make 
sure that I don't introduce more potential concurrency bugs by reducing the 
change I make to the minimum.  I think it will work better for both of us if we 
stick to this separation of concerns. Are you OK with that?

> The ‘StartupLoader’ interface should be removed
> -----------------------------------------------
>
>                 Key: OFBIZ-10638
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10638
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Mathieu Lirzin
>            Assignee: Taher Alkhateeb
>            Priority: Minor
>             Fix For: Upcoming Branch
>
>         Attachments: OFBIZ-10638_Remove-StartupLoader-interface.patch
>
>
> OFBiz used to provide alternate Startup loaders. Nowadays only the container 
> loaders is used. As suggested by Taher [on the dev mailing 
> list|https://lists.apache.org/thread.html/f99d6f661eb8197df8eac6d8ba7db3fa9b7fe2569a4a24ef2fef5cae@%3Cdev.ofbiz.apache.org%3E],
>  the {{StartupLoader}} interface should be removed and startup code using it 
> should be adapted.



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

Reply via email to