Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-1767 #1767

Merged
merged 3 commits into from
Jul 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public class IiopFolbGmsClient implements CallBack {
private Map<String, ClusterInstanceInfo> currentMembers;

private GroupInfoService gis;

private static final String USE_NODE_HOST_FOR_LOCAL_NODE_PROPERTY = "useNodeHostForLocalNode";

private static final String USE_NODE_HOST_FOR_LOCAL_NODE_SYSTEM_PROPERTY = "fish.payara.iiop.gmsClient."
+ USE_NODE_HOST_FOR_LOCAL_NODE_PROPERTY;

private void fineLog( String fmt, Object... args ) {
if(_logger.isLoggable(Level.FINE)) {
Expand Down Expand Up @@ -352,12 +357,19 @@ private ClusterInstanceInfo getClusterInstanceInfo( Server server,
final int weight = Integer.parseInt( server.getLbWeight() ) ;
fineLog( "getClusterInstanceInfo: weight {0}", weight ) ;

final IiopService iservice = config.getExtensionByType(IiopService.class) ;
fineLog( "getClusterInstanceInfo: iservice {0}", iservice ) ;

final String nodeName = server.getNodeRef() ;
String hostName = nodeName ;
if (nodes != null) {
Node node = nodes.getNode( nodeName ) ;
if (node != null) {
if (node.isLocal()) {
// If this is the local node, and the useNodeHostForLocalNode property has not been set at the ORB or
// System level, use the local host name
if ((node.isLocal() && !Boolean.getBoolean(USE_NODE_HOST_FOR_LOCAL_NODE_SYSTEM_PROPERTY))
&& (node.isLocal() && !Boolean.parseBoolean(iservice.getOrb().getPropertyValue(
USE_NODE_HOST_FOR_LOCAL_NODE_PROPERTY, "false")))) {
try {
hostName = InetAddress.getLocalHost().getHostName() ;
} catch (UnknownHostException exc) {
Expand All @@ -372,9 +384,6 @@ private ClusterInstanceInfo getClusterInstanceInfo( Server server,

fineLog( "getClusterInstanceInfo: host {0}", hostName ) ;

final IiopService iservice = config.getExtensionByType(IiopService.class) ;
fineLog( "getClusterInstanceInfo: iservice {0}", iservice ) ;

final List<IiopListener> listeners = iservice.getIiopListener() ;
fineLog( "getClusterInstanceInfo: listeners {0}", listeners ) ;

Expand Down