[
https://issues.apache.org/jira/browse/NIFI-3446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15865038#comment-15865038
]
ASF GitHub Bot commented on NIFI-3446:
--------------------------------------
Github user joewitt commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1478#discussion_r100958624
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowService.java
---
@@ -284,7 +251,7 @@ public boolean isRunning() {
@Override
public void start() throws LifeCycleStartException {
- writeLock.lock();
+ dao.writeProtectFlow();
--- End diff --
this is leaking responsibilities. The 'dao' should either be said to be
thread safe or not. The previous approach was not thread safe and thus we had
locking around it as was in the previous implementation. Here we have some
cases guarded and some not but we're actually invoking a lock within the
non-thread safe class now. This approach is harder to reason over in my
opinion. We should either make the class thread safe and the caller does not
need to do anything special or it should be not thread safe and the calling
class should protect it (as it was). Though this method shows we need to have
some of that logic external so it makes sense to keep the locking as it was
(controlled by the caller with the callee/dao being not thread safe by design)
> Make FlowConfigurationDAO Pluggable
> -----------------------------------
>
> Key: NIFI-3446
> URL: https://issues.apache.org/jira/browse/NIFI-3446
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Core Framework
> Affects Versions: 1.2.0
> Reporter: Peter Wicks
> Assignee: Peter Wicks
> Fix For: 1.2.0
>
>
> FlowConfigurationDAO should be pluggable so that an alternate Flow
> Configuration storage layer can be used.
> This may be a multistep process, this ticket does the first step by moving
> more of the functionality into FlowConfigurationDAO, allows users to override
> (optional) properties in nifi.properties.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)