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

C. Scott Andreas updated CASSANDRA-7597:
----------------------------------------
    Component/s: Lifecycle

> Remove static initializer in DatabaseDescriptor
> -----------------------------------------------
>
>                 Key: CASSANDRA-7597
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7597
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Lifecycle
>         Environment: Cassandra 2.0.9 (earlier version should be affected as 
> well)
>            Reporter: Pavel Sakun
>            Priority: Major
>         Attachments: 7597.txt
>
>
> As discussed below, it's difficult to properly react on invalid configuration 
> values in a client tool that uses cassandra code (here: an sstable loader).
> Reason is that the static initializer in DatabaseDescriptor calls System.exit 
> in case of configuration failures.
> Recommend to implement some "loadAndApplyConfig" method on DatabaseDescriptor 
> and remove the static initializer and let the calling code react accordingly 
> (print error, exit VM).
> All direct and indirect uses of DatabaseDescriptor must be catched to solve 
> this ticket - so this is not a 2.1 ticket.
> --------------------------
> Old Description:
> We're using SSTableSimpleUnsortedWriter API to generate SSTable to be loaded 
> into cassandra. In case of any issue with config DatabaseDescriptor calls 
> System.exit() which is apparently not the thing you expect while using API.
> Test case is simple:
> System.setProperty( "cassandra.config", "" );
> new YamlConfigurationLoader().loadConfig();
> Thread.sleep( 5000 );
> System.out.println("We're still alive"); // this will never be called



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to