[
https://issues.apache.org/jira/browse/FLUME-1273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13293258#comment-13293258
]
Hari Shreedharan commented on FLUME-1273:
-----------------------------------------
I am actually wondering whether we should fix it. We do not actually start any
components anyway. So I guess we are ok, if the agent does not start up. Maybe
we can make the logs clearer?
> Components left in partially-configured state if RuntimeException thrown in
> configure()
> ---------------------------------------------------------------------------------------
>
> Key: FLUME-1273
> URL: https://issues.apache.org/jira/browse/FLUME-1273
> Project: Flume
> Issue Type: Bug
> Affects Versions: v1.1.0
> Reporter: Mike Percy
> Fix For: v1.2.0
>
>
> If a component, such as a Channel or a Sink, throws a RuntimeException (such
> as IllegalArgumentException or IllegalStateException) in its configure()
> method to indicate an error, some strange, non-deterministic stuff happens to
> the rest of the components in the system according to the ordering of the
> components in the configuration properties hash.
> Example:
> 1. Channel throws IllegalArgumentException in configure() method
> 2. Throw propagates to PropertiesFileConfigurationProvider.loadChannels(),
> not caught inside loop (some components not configured)
> 3. Propagates to load() method in same class, Sources/Sinks not configured,
> RuntimeException not caught
> 4. Ends up getting all the way to the
> AbstractFileConfigurationProvider$FileWatcherRunnable.run() method, which
> simply logs an error message("Failed to load configuration data. Exception
> follows.") with a stack trace and continues. So the components will get
> started, etc.
> The behavior should probably be changed to something like the following:
> 1. Exception should be caught and logged at the
> PropertiesFileConfigurationProvider.loadChannels() level (along with each
> other component type such as Source, Sink, etc).
> 2. At the beginning of PropertiesFileConfigurationProvider.loadChannels(), we
> should call conf.getChannels.clear() and only add the components to the conf
> hashes if they were indeed configured successfully. Either that, or at least
> set them to an unconfigured state that the start routine needs to respect so
> avoid starting unconfigured or misconfigured components.
> This work needs to be done carefully to avoid any unintended consequences of
> changing this core logic.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira