Sandeep More created CASSANDRA-9208:
---------------------------------------
Summary: Setting rpc_interface in cassandra.yaml causes NPE during
startup
Key: CASSANDRA-9208
URL: https://issues.apache.org/jira/browse/CASSANDRA-9208
Project: Cassandra
Issue Type: Bug
Components: Config
Environment: Windows and RHEL
Reporter: Sandeep More
Attachments: SuggestedDataBaseDescriptor.diff
In the cassandra.yaml file when "rpc_interface" option is set it causes a NPE.
Upon further investigation it turns out that there is a serious problem is in
the way this logic is handled in the code DatabaseDescriptor.java (#374).
Following is the code snippet
else if (conf.rpc_interface != null)
{
listenAddress = getNetworkInterfaceAddress(conf.rpc_interface,
"rpc_interface");
}
else
{
rpcAddress = FBUtilities.getLocalAddress();
}
If you notice,
1) The code above sets the "listenAddress" instead of "rpcAddress".
2) The function getNetworkInterfaceAddress() blindly assumes that this is
called to set the "listenAddress" (see line 171). The "configName" variable
passed to the function is royally ignored and only used for printing out
exception (which again is misleading)
I am also attaching a suggested patch (NOTE: the patch tries to address this
issue, the function getNetworkInterfaceAddress() needs revision ).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)