Re: [Dev] [C5] Clustering test-cases failing after upgrading to Hazelcast 3.5.0

2015-08-11 Thread Kishanthan Thangarajah
+1, let's add a check for loopback address.

On Mon, Aug 10, 2015 at 5:50 PM, Aruna Karunarathna ar...@wso2.com wrote:

 Hi all,

 I am currently in the process of upgrading the hazelcast version to 3.5.0.
 After the upgrade following test-cases are failing.

 INFO: [127.0.0.1]:0 [wso2.wka.domain] [3.5] Hazelcast Shutdown is
 completed in 358 ms.
 Aug 10, 2015 5:36:44 PM com.hazelcast.core.LifecycleService
 INFO: [127.0.0.1]:0 [wso2.wka.domain] [3.5] Address[127.0.0.1]:0 is
 SHUTDOWN
 Tests run: 64, Failures: 2, Errors: 0, Skipped: 4, Time elapsed: 11.755
 sec  FAILURE!

 Results :

 Failed tests:
 testMulticastMembershipScheme(org.wso2.carbon.clustering.MulitcastMembershipSchemeTestCase):
 expected:2 but was:1

 testWKAMembershipScheme(org.wso2.carbon.clustering.WKAMembershipSchemeTestCase):
 expected:2 but was:1


 After further analyzing found that hazelcast doesn't accept localhost as
 the hostName in 3.5 verssion. in Carbon 4 there is a warning defined if the
 host-name is local. [1]

 What would be the best way to fix this?. Shall we add a local host check
 when initializing the instance [2]?.

 if (localMemberHost != null* 
 !localMemberHost.equalsIgnoreCase(127.0.0.1) *
 *!localMemberHost.equalsIgnoreCase(localhost)*) {
 localMemberHost = localMemberHost.trim();
 } else {
 try {
 localMemberHost = ClusterUtil.getIpAddress();
 } catch (SocketException e) {
 String msg = Could not set local member host;
 logger.error(msg, e);
 throw new ClusterInitializationException(msg, e);
 }
 }

 [1].
 https://github.com/wso2/carbon4-kernel/blob/master/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/clustering/hazelcast/HazelcastClusteringAgent.java#L131
 [2].
 https://github.com/wso2/carbon-kernel/blob/master/core/src/main/java/org/wso2/carbon/clustering/hazelcast/HazelcastClusteringAgent.java#L111

 Regards,
 Aruna
 --

 *Aruna Sujith Karunarathna *| Software Engineer
 WSO2, Inc | lean. enterprise. middleware.
 #20, Palm Grove, Colombo 03, Sri Lanka
 Mobile: +94 71 9040362 | Work: +94 112145345
 Email: ar...@wso2.com | Web: www.wso2.com





-- 
*Kishanthan Thangarajah*
Associate Technical Lead,
Platform Technologies Team,
WSO2, Inc.
lean.enterprise.middleware

Mobile - +94773426635
Blog - *http://kishanthan.wordpress.com http://kishanthan.wordpress.com*
Twitter - *http://twitter.com/kishanthan http://twitter.com/kishanthan*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [C5] Clustering test-cases failing after upgrading to Hazelcast 3.5.0

2015-08-10 Thread Aruna Karunarathna
Hi all,

I am currently in the process of upgrading the hazelcast version to 3.5.0.
After the upgrade following test-cases are failing.

INFO: [127.0.0.1]:0 [wso2.wka.domain] [3.5] Hazelcast Shutdown is completed
in 358 ms.
Aug 10, 2015 5:36:44 PM com.hazelcast.core.LifecycleService
INFO: [127.0.0.1]:0 [wso2.wka.domain] [3.5] Address[127.0.0.1]:0 is SHUTDOWN
Tests run: 64, Failures: 2, Errors: 0, Skipped: 4, Time elapsed: 11.755 sec
 FAILURE!

Results :

Failed tests:
testMulticastMembershipScheme(org.wso2.carbon.clustering.MulitcastMembershipSchemeTestCase):
expected:2 but was:1

testWKAMembershipScheme(org.wso2.carbon.clustering.WKAMembershipSchemeTestCase):
expected:2 but was:1


After further analyzing found that hazelcast doesn't accept localhost as
the hostName in 3.5 verssion. in Carbon 4 there is a warning defined if the
host-name is local. [1]

What would be the best way to fix this?. Shall we add a local host check
when initializing the instance [2]?.

if (localMemberHost != null* 
!localMemberHost.equalsIgnoreCase(127.0.0.1) *
*!localMemberHost.equalsIgnoreCase(localhost)*) {
localMemberHost = localMemberHost.trim();
} else {
try {
localMemberHost = ClusterUtil.getIpAddress();
} catch (SocketException e) {
String msg = Could not set local member host;
logger.error(msg, e);
throw new ClusterInitializationException(msg, e);
}
}

[1].
https://github.com/wso2/carbon4-kernel/blob/master/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/clustering/hazelcast/HazelcastClusteringAgent.java#L131
[2].
https://github.com/wso2/carbon-kernel/blob/master/core/src/main/java/org/wso2/carbon/clustering/hazelcast/HazelcastClusteringAgent.java#L111

Regards,
Aruna
-- 

*Aruna Sujith Karunarathna *| Software Engineer
WSO2, Inc | lean. enterprise. middleware.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 71 9040362 | Work: +94 112145345
Email: ar...@wso2.com | Web: www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev