[
https://issues.apache.org/jira/browse/NIFI-8212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17297623#comment-17297623
]
ASF subversion and git services commented on NIFI-8212:
-------------------------------------------------------
Commit b523698534679938865a3ac401d901e8db411225 in nifi's branch
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=b523698 ]
NIFI-8212: Refactored StandardExtensionDiscoveringManager to avoid using
ServiceLoader
Instead, it will look at the ServiceLoader file and read the names of the
classes but avoid instantiating all of the objects or loading the classes into
memory.
- Updated Doc Generation so that if the documentation for a given NAR already
exists, it doesn't delete it and re-generate it. This was necessary because we
are no longer instantiating an instance of each component and instead lazily
creating the components as necessary.
- Removed stateless version of extension registry because it's no longer
necessary
This closes #4852
Signed-off-by: David Handermann <[email protected]>
> Improve startup times for Stateless
> -----------------------------------
>
> Key: NIFI-8212
> URL: https://issues.apache.org/jira/browse/NIFI-8212
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Core Framework, NiFi Stateless
> Reporter: Mark Payne
> Assignee: Mark Payne
> Priority: Major
> Fix For: 1.14.0
>
> Time Spent: 4h 50m
> Remaining Estimate: 0h
>
> There are a handful of things that happen in NiFi (and stateless) startup
> that take quite a while that can be improved:
> * We unpack all NAR's if they are not already unpacked. If they are
> unpacked, we perform a hash of the nar to ensure that it matches with what
> was unpacked. With stateless, though, we download nars on demand and name
> them a temporary file until the download completes, then rename them. As a
> result, we don't expect any hash conflicts unless it's a SNAPSHOT nar. We
> should avoid calculating hashes against all of the nars on startup.
> * We use the ServiceLoader to load all extensions. Given the number of
> extensions that we have and the prevalence of things like ObjectMapper as
> member variables, this can be rather expensive. We should instead just read
> the ServiceLoader file and create the objects on-demand. The temp components
> are needed for generating documentation, for example. But otherwise they are
> not needed. And stateless doesn't bother generating docs (since there's no UI
> to view them). This avoids creating lots of expensive objects and can also
> prevent loading huge numbers of classes into memory.
> * StringEncryptor is almost never used in stateless. We should lazy load it
> if needed.
> * Controller Service enabling is very slow in stateless. Currently, it
> asynchronously starts all services. Then it keeps polling to see if services
> are enabled and if not sleeps for a short period. We should instead move to a
> method of using Futures or wait/notify, etc. so that service enablement can
> completely quickly.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)