Discussion:
Fwd: Setting Locking protocol
(too old to reply)
sujit kumar
2011-05-10 16:05:35 UTC
Permalink
Hi friends

I am in process of migrating from jgroups-2.10.0.GA to jgroups-2.12.0.Final
for using LockService.
I searched all over on web to see an example for how to set a locking
protocol as Bela Ban has mentioned as /home/bela/lock.xml in one of his
blog. But unfortunately I could not find it.

Currently my config is defined as

#* **jgroups* locking* config*
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=5):FILE_PING(location=/
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(timeout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(timeout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=3000;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_size=32767):pbcast.STREAMING_STATE_TRANSFER

When I tried just adding CENTRAL_LOCK(num_backups=1) in the avove defined
property I get error as and I try to get Lock as following code

Jchannel channel =* new* JChannel(getProperty("jgroups.locking.config"));
LockService lockService =* new* LockService(channel);
I hit following error

java.lang.IllegalStateException: Channel configuration must include a
locking protocol (subclass of org.jgroups.protocols.Locking)

at
org.jgroups.blocks.locking.LockService.setChannel(LockService.java:55)


Can someone please help me on how shall I overcome this problem.


Thanks
Sujit
Bela Ban
2011-05-19 09:30:18 UTC
Permalink
Post by sujit kumar
Hi friends
I am in process of migrating from jgroups-2.10.0.GA to jgroups-2.12.0.Final
for using LockService.
I searched all over on web to see an example for how to set a locking
protocol as Bela Ban has mentioned as /home/bela/lock.xml in one of his
blog. But unfortunately I could not find it.
Take a look at
http://www.jgroups.org/manual/html/user-building-blocks.html#d0e2543.
Simply copy udp.xml and add <CENTRAL_LOCK /> or <PEER_LOCK/> to the top
of the stack (over FLUSH).
Post by sujit kumar
Currently my config is defined as
#* **jgroups* locking* config*
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=5):FILE_PING(location=/
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(timeout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(timeout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=3000;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_size=32767):pbcast.STREAMING_STATE_TRANSFER
Ouch ! I discourage use of the plain string notation, why don't you
switch to XML ?

But if you have to, the new config would be

#* **jgroups* locking* config*
Post by sujit kumar
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=5):FILE_PING(location=/
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(timeout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(timeout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=3000;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_size=32767):pbcast.STREAMING_STATE_TRANSFER:CENTRAL_LOCK
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
Bela Ban
2011-05-25 08:20:27 UTC
Permalink
The error message below says it all: a bind address cannot be the
wildcard address (0.0.0.0). This has nothing to do with the locking
protocol. I suggest remove bind_addr=0.0.0.0 and set the real IP address
Hi Bela
Sorry but I was unable to pick the attached thread from
'javagroups-users' forum so replying this way.
After setting up CENTRAL_LOCK protocol as you suggested we are facing
following issue intermittently.
Caused by: org.jgroups.ChannelException: failed to start protocol stack
at org.jgroups.JChannel.startStack(JChannel.java:1787)
at org.jgroups.JChannel.connect(JChannel.java:413)
at org.jgroups.JChannel.connect(JChannel.java:388)
at
com.csg.cs.riskit.tsrd.lock.JGroupsDistributedLockManager.initManager(JG
roupsDistributedLockManager.java:70)
... 73 more
Caused by: java.net.BindException: bind_addr /0.0.0.0 is not a valid
interface: java.net.BindException: Address already in use
at org.jgroups.util.Util.createServerSocket(Util.java:3055)
at
org.jgroups.blocks.TCPConnectionMap.<init>(TCPConnectionMap.java:87)
at
org.jgroups.blocks.TCPConnectionMap.<init>(TCPConnectionMap.java:54)
at org.jgroups.protocols.TCP.createConnectionMap(TCP.java:130)
at org.jgroups.protocols.TCP.start(TCP.java:64)
at
org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:990)
at org.jgroups.JChannel.startStack(JChannel.java:1784)
... 76 more
[ERROR][25-May 08:06:47,620][] error sending notification
[NotificationBus]
ChannelNotConnectedException
at
org.jgroups.JChannel.checkClosedOrNotConnected(JChannel.java:1840)
at org.jgroups.JChannel.send(JChannel.java:726)
at
org.jgroups.blocks.NotificationBus.sendNotification(NotificationBus.java
:161)
at
org.jgroups.blocks.NotificationBus.sendNotification(NotificationBus.java
:143)
at
net.sf.ehcache.distribution.jgroups.JGroupManager.send(JGroupManager.jav
a:271)
at
net.sf.ehcache.distribution.jgroups.JGroupManager.send(JGroupManager.jav
a:263)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.flushReplicat
ionQueue(JGroupsCacheReplicator.java:380)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.replicationTh
readMain(JGroupsCacheReplicator.java:338)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.access$000(JG
roupsCacheReplicator.java:45)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator$ReplicationTh
read.run(JGroupsCacheReplicator.java:317)
[ERROR][25-May 08:07:12,646][] failed running task
[TimeScheduler2]
java.lang.NullPointerException
at java.io.File.<init>(File.java:305)
at
org.jgroups.protocols.FILE_PING.writeToFile(FILE_PING.java:221)
at
org.jgroups.protocols.FILE_PING$WriterTask.run(FILE_PING.java:246)
at
org.jgroups.util.TimeScheduler2$RecurringTask.run(TimeScheduler2.java:59
2)
at
org.jgroups.util.TimeScheduler2$MyTask.run(TimeScheduler2.java:524)
at
org.jgroups.util.TimeScheduler2$Entry.execute(TimeScheduler2.java:429)
at
org.jgroups.util.TimeScheduler2$1.run(TimeScheduler2.java:295)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:908)
at java.lang.Thread.run(Thread.java:619)
ere is my code which uses locking..
channel1 = new JChannel(getProperty("jgroups.locking.config"));
lockService = new LockService(channel1);
channel1.connect("lock-cluster");
lockService.addLockListener(this);
JmxConfigurator.registerChannel(channel1, mbeanserver, "lock-service",
channel1.getClusterName(), true);
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 (O)
________________________________
Sent: 19 May 2011 18:33
To: Kumar, Sujit
Subject: Fwd: [javagroups-users] Fwd: Setting Locking protocol
---------- Forwarded message ----------
Date: 19 May 2011 17:30
Subject: Re: [javagroups-users] Fwd: Setting Locking protocol
Post by sujit kumar
Hi friends
I am in process of migrating from jgroups-2.10.0.GA to
jgroups-2.12.0.Final
Post by sujit kumar
for using LockService.
I searched all over on web to see an example for how to set a locking
protocol as Bela Ban has mentioned as /home/bela/lock.xml in one of
his
Post by sujit kumar
blog. But unfortunately I could not find it.
Take a look at
http://www.jgroups.org/manual/html/user-building-blocks.html#d0e2543.
Simply copy udp.xml and add<CENTRAL_LOCK /> or<PEER_LOCK/> to the top
of the stack (over FLUSH).
Post by sujit kumar
Currently my config is defined as
#* **jgroups* locking* config*
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=
5):FILE_PING(location=/
Post by sujit kumar
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max
_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(tim
eout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmi
t_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(ti
meout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossi
p=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=30
00;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_
size=32767):pbcast.STREAMING_STATE_TRANSFER
Ouch ! I discourage use of the plain string notation, why don't you
switch to XML ?
But if you have to, the new config would be
#* **jgroups* locking* config*
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=
5):FILE_PING(location=/
Post by sujit kumar
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max
_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(tim
eout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmi
t_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(ti
meout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossi
p=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=30
00;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_
size=32767):pbcast.STREAMING_STATE_TRANSFER:CENTRAL_LOCK
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
------------------------------------------------------------------------
------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
javagroups-users mailing list
https://lists.sourceforge.net/lists/listinfo/javagroups-users
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
sujit kumar
2011-05-25 12:53:05 UTC
Permalink
Hi Bela

Thanks a lot for your kind help.
By real IP do you mean IP of the box(e.g Solaris/Linux) where I have my
manage server instances?
I am using jGroups with Weblogic 10.3

Regards
Sujit
Post by Bela Ban
The error message below says it all: a bind address cannot be the
wildcard address (0.0.0.0). This has nothing to do with the locking
protocol. I suggest remove bind_addr=0.0.0.0 and set the real IP address
Hi Bela
Sorry but I was unable to pick the attached thread from
'javagroups-users' forum so replying this way.
After setting up CENTRAL_LOCK protocol as you suggested we are facing
following issue intermittently.
Caused by: org.jgroups.ChannelException: failed to start protocol stack
at org.jgroups.JChannel.startStack(JChannel.java:1787)
at org.jgroups.JChannel.connect(JChannel.java:413)
at org.jgroups.JChannel.connect(JChannel.java:388)
at
com.csg.cs.riskit.tsrd.lock.JGroupsDistributedLockManager.initManager(JG
roupsDistributedLockManager.java:70)
... 73 more
Caused by: java.net.BindException: bind_addr /0.0.0.0 is not a valid
interface: java.net.BindException: Address already in use
at org.jgroups.util.Util.createServerSocket(Util.java:3055)
at
org.jgroups.blocks.TCPConnectionMap.<init>(TCPConnectionMap.java:87)
at
org.jgroups.blocks.TCPConnectionMap.<init>(TCPConnectionMap.java:54)
at org.jgroups.protocols.TCP.createConnectionMap(TCP.java:130)
at org.jgroups.protocols.TCP.start(TCP.java:64)
at
org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:990)
at org.jgroups.JChannel.startStack(JChannel.java:1784)
... 76 more
[ERROR][25-May 08:06:47,620][] error sending notification
[NotificationBus]
ChannelNotConnectedException
at
org.jgroups.JChannel.checkClosedOrNotConnected(JChannel.java:1840)
at org.jgroups.JChannel.send(JChannel.java:726)
at
org.jgroups.blocks.NotificationBus.sendNotification(NotificationBus.java
:161)
at
org.jgroups.blocks.NotificationBus.sendNotification(NotificationBus.java
:143)
at
net.sf.ehcache.distribution.jgroups.JGroupManager.send(JGroupManager.jav
a:271)
at
net.sf.ehcache.distribution.jgroups.JGroupManager.send(JGroupManager.jav
a:263)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.flushReplicat
ionQueue(JGroupsCacheReplicator.java:380)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.replicationTh
readMain(JGroupsCacheReplicator.java:338)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.access$000(JG
roupsCacheReplicator.java:45)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator$ReplicationTh
read.run(JGroupsCacheReplicator.java:317)
[ERROR][25-May 08:07:12,646][] failed running task
[TimeScheduler2]
java.lang.NullPointerException
at java.io.File.<init>(File.java:305)
at
org.jgroups.protocols.FILE_PING.writeToFile(FILE_PING.java:221)
at
org.jgroups.protocols.FILE_PING$WriterTask.run(FILE_PING.java:246)
at
org.jgroups.util.TimeScheduler2$RecurringTask.run(TimeScheduler2.java:59
2)
at
org.jgroups.util.TimeScheduler2$MyTask.run(TimeScheduler2.java:524)
at
org.jgroups.util.TimeScheduler2$Entry.execute(TimeScheduler2.java:429)
at
org.jgroups.util.TimeScheduler2$1.run(TimeScheduler2.java:295)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:908)
at java.lang.Thread.run(Thread.java:619)
ere is my code which uses locking..
channel1 = new JChannel(getProperty("jgroups.locking.config"));
lockService = new LockService(channel1);
channel1.connect("lock-cluster");
lockService.addLockListener(this);
JmxConfigurator.registerChannel(channel1, mbeanserver, "lock-service",
channel1.getClusterName(), true);
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 (O)
________________________________
Sent: 19 May 2011 18:33
To: Kumar, Sujit
Subject: Fwd: [javagroups-users] Fwd: Setting Locking protocol
---------- Forwarded message ----------
Date: 19 May 2011 17:30
Subject: Re: [javagroups-users] Fwd: Setting Locking protocol
Post by sujit kumar
Hi friends
I am in process of migrating from jgroups-2.10.0.GA to
jgroups-2.12.0.Final
Post by sujit kumar
for using LockService.
I searched all over on web to see an example for how to set a locking
protocol as Bela Ban has mentioned as /home/bela/lock.xml in one of
his
Post by sujit kumar
blog. But unfortunately I could not find it.
Take a look at
http://www.jgroups.org/manual/html/user-building-blocks.html#d0e2543.
Simply copy udp.xml and add<CENTRAL_LOCK /> or<PEER_LOCK/> to the top
of the stack (over FLUSH).
Post by sujit kumar
Currently my config is defined as
#* **jgroups* locking* config*
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=
5):FILE_PING(location=/
Post by sujit kumar
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max
_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(tim
eout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmi
t_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(ti
meout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossi
p=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=30
00;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_
size=32767):pbcast.STREAMING_STATE_TRANSFER
Ouch ! I discourage use of the plain string notation, why don't you
switch to XML ?
But if you have to, the new config would be
#* **jgroups* locking* config*
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=
5):FILE_PING(location=/
Post by sujit kumar
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max
_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(tim
eout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmi
t_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(ti
meout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossi
p=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=30
00;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_
size=32767):pbcast.STREAMING_STATE_TRANSFER:CENTRAL_LOCK
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
------------------------------------------------------------------------
------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
javagroups-users mailing list
https://lists.sourceforge.net/lists/listinfo/javagroups-users
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
javagroups-users mailing list
https://lists.sourceforge.net/lists/listinfo/javagroups-users
Bela Ban
2011-05-25 13:54:18 UTC
Permalink
Yes, correct. Note that you can also use keywords such as "global" or
"site_local" to pick a global or site local IP address
Hi Bela
Thanks a lot for your kind help.
By real IP do you mean IP of the box(e.g Solaris/Linux) where I have my
manage server instances?
I am using jGroups with Weblogic 10.3
Regards
Sujit
Post by Bela Ban
The error message below says it all: a bind address cannot be the
wildcard address (0.0.0.0). This has nothing to do with the locking
protocol. I suggest remove bind_addr=0.0.0.0 and set the real IP address
Hi Bela
Sorry but I was unable to pick the attached thread from
'javagroups-users' forum so replying this way.
After setting up CENTRAL_LOCK protocol as you suggested we are facing
following issue intermittently.
Caused by: org.jgroups.ChannelException: failed to start protocol stack
at org.jgroups.JChannel.startStack(JChannel.java:1787)
at org.jgroups.JChannel.connect(JChannel.java:413)
at org.jgroups.JChannel.connect(JChannel.java:388)
at
com.csg.cs.riskit.tsrd.lock.JGroupsDistributedLockManager.initManager(JG
roupsDistributedLockManager.java:70)
... 73 more
Caused by: java.net.BindException: bind_addr /0.0.0.0 is not a valid
interface: java.net.BindException: Address already in use
at org.jgroups.util.Util.createServerSocket(Util.java:3055)
at
org.jgroups.blocks.TCPConnectionMap.<init>(TCPConnectionMap.java:87)
at
org.jgroups.blocks.TCPConnectionMap.<init>(TCPConnectionMap.java:54)
at org.jgroups.protocols.TCP.createConnectionMap(TCP.java:130)
at org.jgroups.protocols.TCP.start(TCP.java:64)
at
org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:990)
at org.jgroups.JChannel.startStack(JChannel.java:1784)
... 76 more
[ERROR][25-May 08:06:47,620][] error sending notification
[NotificationBus]
ChannelNotConnectedException
at
org.jgroups.JChannel.checkClosedOrNotConnected(JChannel.java:1840)
at org.jgroups.JChannel.send(JChannel.java:726)
at
org.jgroups.blocks.NotificationBus.sendNotification(NotificationBus.java
:161)
at
org.jgroups.blocks.NotificationBus.sendNotification(NotificationBus.java
:143)
at
net.sf.ehcache.distribution.jgroups.JGroupManager.send(JGroupManager.jav
a:271)
at
net.sf.ehcache.distribution.jgroups.JGroupManager.send(JGroupManager.jav
a:263)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.flushReplicat
ionQueue(JGroupsCacheReplicator.java:380)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.replicationTh
readMain(JGroupsCacheReplicator.java:338)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator.access$000(JG
roupsCacheReplicator.java:45)
at
net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicator$ReplicationTh
read.run(JGroupsCacheReplicator.java:317)
[ERROR][25-May 08:07:12,646][] failed running task
[TimeScheduler2]
java.lang.NullPointerException
at java.io.File.<init>(File.java:305)
at
org.jgroups.protocols.FILE_PING.writeToFile(FILE_PING.java:221)
at
org.jgroups.protocols.FILE_PING$WriterTask.run(FILE_PING.java:246)
at
org.jgroups.util.TimeScheduler2$RecurringTask.run(TimeScheduler2.java:59
2)
at
org.jgroups.util.TimeScheduler2$MyTask.run(TimeScheduler2.java:524)
at
org.jgroups.util.TimeScheduler2$Entry.execute(TimeScheduler2.java:429)
at
org.jgroups.util.TimeScheduler2$1.run(TimeScheduler2.java:295)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:908)
at java.lang.Thread.run(Thread.java:619)
ere is my code which uses locking..
channel1 = new JChannel(getProperty("jgroups.locking.config"));
lockService = new LockService(channel1);
channel1.connect("lock-cluster");
lockService.addLockListener(this);
JmxConfigurator.registerChannel(channel1, mbeanserver, "lock-service",
channel1.getClusterName(), true);
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 (O)
________________________________
Sent: 19 May 2011 18:33
To: Kumar, Sujit
Subject: Fwd: [javagroups-users] Fwd: Setting Locking protocol
---------- Forwarded message ----------
Date: 19 May 2011 17:30
Subject: Re: [javagroups-users] Fwd: Setting Locking protocol
Post by sujit kumar
Hi friends
I am in process of migrating from jgroups-2.10.0.GA to
jgroups-2.12.0.Final
Post by sujit kumar
for using LockService.
I searched all over on web to see an example for how to set a locking
protocol as Bela Ban has mentioned as /home/bela/lock.xml in one of
his
Post by sujit kumar
blog. But unfortunately I could not find it.
Take a look at
http://www.jgroups.org/manual/html/user-building-blocks.html#d0e2543.
Simply copy udp.xml and add<CENTRAL_LOCK /> or<PEER_LOCK/> to the top
of the stack (over FLUSH).
Post by sujit kumar
Currently my config is defined as
#* **jgroups* locking* config*
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=
5):FILE_PING(location=/
Post by sujit kumar
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max
_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(tim
eout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmi
t_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(ti
meout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossi
p=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=30
00;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_
size=32767):pbcast.STREAMING_STATE_TRANSFER
Ouch ! I discourage use of the plain string notation, why don't you
switch to XML ?
But if you have to, the new config would be
#* **jgroups* locking* config*
jgroups.locking.config=TCP(bind_addr=0.0.0.0;bind_port=21200;port_range=
5):FILE_PING(location=/
Post by sujit kumar
*app*/log/*dev*/*jgroupslockingcontrol*
;num_initial_members=1;num_ping_requests=20):MERGE2(min_interval=500;max
_interval=10000):FD_SOCK:FD(timeout=2000;max_tries=4):VERIFY_SUSPECT(tim
eout=1500):BARRIER:pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmi
t_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):UNICAST(ti
meout=300,600,1200):pbcast.STABLE(stability_delay=1000;desired_avg_gossi
p=50000;max_bytes=400K):pbcast.GMS(print_local_addr=true;join_timeout=30
00;view_bundling=true):FC(max_credits=2M;min_threshold=0.10):FRAG2(frag_
size=32767):pbcast.STREAMING_STATE_TRANSFER:CENTRAL_LOCK
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
------------------------------------------------------------------------
------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
javagroups-users mailing list
https://lists.sourceforge.net/lists/listinfo/javagroups-users
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
javagroups-users mailing list
https://lists.sourceforge.net/lists/listinfo/javagroups-users
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
sujit kumar
2011-09-20 00:08:17 UTC
Permalink
Hi team

We are using jgroups-2.10.0.GA for distributed locking and even after
calling unlock after each successful call to lock() we hit error as "Unable
to unlock the object" issue.
Any relevant detail will be a great help.

We are switching to jgroups-2.12.0.Final , please suggest whether
unlockAll() will release all locks acquired by jGroup smoothly and would be
safer option in case needed.
I have coded isLocked as following ..does this look fine?

*public** boolean* isLocked(*final* Object attr) {


Lock lock =* lockService*.getLock(attr.toString());
* if* (lock.tryLock()) {
lock.unlock();
* return** false*;
}* else* {
* return** true*;
}
}
Bela Ban
2011-09-20 07:54:44 UTC
Permalink
Does the toString() method of the object always resolve to the same string ?
I don't recommend this; it's better to pick a static lock name.

Also, you should call lock.unlock() in a finally clause.
Post by sujit kumar
Hi team
We are using jgroups-2.10.0.GA <http://jgroups-2.10.0.GA> for
distributed locking and even after calling unlock after each successful
call to lock() we hit error as "Unable to unlock the object" issue.
Any relevant detail will be a great help.
We are switching to jgroups-2.12.0.Final , please suggest whether
unlockAll() will release all locks acquired by jGroup smoothly and would
be safer option in case needed.
I have coded isLocked as following ..does this look fine?
*public**boolean* isLocked(*final* Object attr) {
Lock lock =/lockService/.getLock(attr.toString());
*if* (lock.tryLock()) {
lock.unlock();
*return**false*;
}*else* {
*return**true*;
}
}
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
Bela Ban
2011-09-21 14:10:51 UTC
Permalink
Refusing to release a lock would be a bug *if* the lock is really owned
by thread calling unblock().

If you have a use case which fails, I'd be hapy to look at it
Hi Bela
Thanks a lot for your quick reply.
We will change the .toString() implementation to use static text.
And yes we are calling unlock() always from finally after we done with
locked resource.
Just to check again on unlockAll(), is it safe/guaranteed to invoke to
release all locks associated
To given channel ?
Is there could be any reason where jGroup would just refuse to release
the lock ?
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 (O)
-----Original Message-----
Sent: 20 September 2011 15:55
To: sujit kumar
Subject: Re: Setting Locking protocol
Does the toString() method of the object always resolve to the same string ?
I don't recommend this; it's better to pick a static lock name.
Also, you should call lock.unlock() in a finally clause.
Post by sujit kumar
Hi team
We are using jgroups-2.10.0.GA<http://jgroups-2.10.0.GA> for
distributed locking and even after calling unlock after each
successful call to lock() we hit error as "Unable to unlock the
object" issue.
Post by sujit kumar
Any relevant detail will be a great help.
We are switching to jgroups-2.12.0.Final , please suggest whether
unlockAll() will release all locks acquired by jGroup smoothly and
would be safer option in case needed.
I have coded isLocked as following ..does this look fine?
*public**boolean* isLocked(*final* Object attr) {
Lock lock =/lockService/.getLock(attr.toString());
*if* (lock.tryLock()) {
lock.unlock();
*return**false*;
}*else* {
*return**true*;
}
}
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
===============================================================================
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
===============================================================================
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
sujit kumar
2011-09-21 18:37:57 UTC
Permalink
Hi Bela

Just to reiterate this problem has come with 2.10.0.GA version and probably
first time we have seen this in last 2 years.
Here is the code snippet which resulted in throwing LockNotReleasedException


public void unlock(final Object attr) {
try {
lockManager.unlock(attr, channel.getLocalAddress() +
Thread.currentThread().getName());
} catch (final LockNotReleasedException e) {
*-------------------->>>>>>>*
} catch (final ChannelException c) { }

}
--------------------------------client----------------------------

Integer lockKey= getLockId();
boolean gotLock = false;

if (lockManager.lock(lockKey)) {
gotLock = true;

// other code lines

finally {
if (gotLock) {
lockManager.unlock(lockKey);
}
}
Refusing to release a lock would be a bug *if* the lock is really owned by
thread calling unblock().
If you have a use case which fails, I'd be hapy to look at it
Hi Bela
Thanks a lot for your quick reply.
We will change the .toString() implementation to use static text.
And yes we are calling unlock() always from finally after we done with
locked resource.
Just to check again on unlockAll(), is it safe/guaranteed to invoke to
release all locks associated
To given channel ?
Is there could be any reason where jGroup would just refuse to release
the lock ?
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 (O)
-----Original Message-----
Sent: 20 September 2011 15:55
To: sujit kumar
Kumar, Sujit
Subject: Re: Setting Locking protocol
Does the toString() method of the object always resolve to the same string ?
I don't recommend this; it's better to pick a static lock name.
Also, you should call lock.unlock() in a finally clause.
Post by sujit kumar
Hi team
We are using jgroups-2.10.0.GA<http://**jgroups-2.10.0.GA<http://jgroups-2.10.0.GA>>
for
distributed locking and even after calling unlock after each
successful call to lock() we hit error as "Unable to unlock the
object" issue.
Post by sujit kumar
Any relevant detail will be a great help.
We are switching to jgroups-2.12.0.Final , please suggest whether
unlockAll() will release all locks acquired by jGroup smoothly and
would be safer option in case needed.
I have coded isLocked as following ..does this look fine?
*public**boolean* isLocked(*final* Object attr) {
Lock lock =/lockService/.getLock(attr.**toString());
*if* (lock.tryLock()) {
lock.unlock();
*return**false*;
}*else* {
*return**true*;
}
}
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
==============================**==============================**
===================
Please access the attached hyperlink for an important electronic
http://www.credit-suisse.com/**legal/en/disclaimer_email_ib.**html<http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html>
==============================**==============================**
===================
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
--
Thanks
Sujit
Bela Ban
2011-09-22 08:08:42 UTC
Permalink
Oh, wait, are you using the old (and unsupported) LockManager ? I
referred to the new LockService...

If you send me a complete (small) test program which triggers the
problem, I'll take a look. Only for LockService, though, I don't support
LockManager.
Hi Bela
Just to reiterate this problem has come with 2.10.0.GA
<http://2.10.0.GA> version and probably first time we have seen this in
last 2 years.
Here is the code snippet which resulted in throwing LockNotReleasedException
public void unlock(final Object attr) {
try {
lockManager.unlock(attr, channel.getLocalAddress() +
Thread.currentThread().getName());
} catch (final LockNotReleasedException e) {
*-------------------->>>>>>>*
} catch (final ChannelException c) { }
}
--------------------------------client----------------------------
Integer lockKey= getLockId();
boolean gotLock = false;
if (lockManager.lock(lockKey)) {
gotLock = true;
// other code lines
finally {
if (gotLock) {
lockManager.unlock(lockKey);
}
}
Refusing to release a lock would be a bug *if* the lock is really
owned by thread calling unblock().
If you have a use case which fails, I'd be hapy to look at it
Hi Bela
Thanks a lot for your quick reply.
We will change the .toString() implementation to use static text.
And yes we are calling unlock() always from finally after we done with
locked resource.
Just to check again on unlockAll(), is it safe/guaranteed to invoke to
release all locks associated
To given channel ?
Is there could be any reason where jGroup would just refuse to release
the lock ?
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 <tel:%2B65%206306%209062> (O)
-----Original Message-----
Sent: 20 September 2011 15:55
To: sujit kumar
Subject: Re: Setting Locking protocol
Does the toString() method of the object always resolve to the same
string ?
I don't recommend this; it's better to pick a static lock name.
Also, you should call lock.unlock() in a finally clause.
Hi team
We are using jgroups-2.10.0.GA
<http://jgroups-2.10.0.GA><http://__jgroups-2.10.0.GA
<http://jgroups-2.10.0.GA>> for
distributed locking and even after calling unlock after each
successful call to lock() we hit error as "Unable to unlock the
object" issue.
Any relevant detail will be a great help.
We are switching to jgroups-2.12.0.Final , please suggest whether
unlockAll() will release all locks acquired by jGroup smoothly and
would be safer option in case needed.
I have coded isLocked as following ..does this look fine?
*public**boolean* isLocked(*final* Object attr) {
Lock lock =/lockService/.getLock(attr.__toString());
*if* (lock.tryLock()) {
lock.unlock();
*return**false*;
}*else* {
*return**true*;
}
}
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
==============================__==============================__===================
Please access the attached hyperlink for an important electronic
http://www.credit-suisse.com/__legal/en/disclaimer_email_ib.__html
<http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html>
==============================__==============================__===================
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
--
Thanks
Sujit
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
Bela Ban
2011-09-22 08:38:08 UTC
Permalink
Thanks a lot Bela..
Though we have upgraded recently to 2.12.0.Final and using LockService
now but in production we still have old version where we have hit this
issue.
OK. I really can't say much about LockManager, I didn't write that class.
As I mentioned it is not a reproducible error and has happened just once.
To conclude, can you please just let me know that what are the possible
reasons for getting***LockNotReleasedException*?
This will really help us.
As I said, I don't know much about LockManager, except that it had a
complex two-phase lock acquisition phase, and perhaps the exception you
saw was a result of an edge case not being covered.
With LockService is there still a chance to hit this error during
unlock() ?
No, locks should always be unlocked. I would have to check for the case
when the coordinator crashes *while* unlocking a lock though...
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 (O)
-----Original Message-----
Sent: 22 September 2011 16:09
To: sujit kumar
Subject: Re: Setting Locking protocol
Oh, wait, are you using the old (and unsupported) LockManager ? I
referred to the new LockService...
If you send me a complete (small) test program which triggers the
problem, I'll take a look. Only for LockService, though, I don't support
LockManager.
Hi Bela
Just to reiterate this problem has come with 2.10.0.GA
<_http://2.10.0.GA_> version and probably first time we have seen this
in last 2 years.
Here is the code snippet which resulted in throwing
LockNotReleasedException
public void unlock(final Object attr) {
try {
lockManager.unlock(attr, channel.getLocalAddress() +
Thread.currentThread().getName());
} catch (final LockNotReleasedException e) {
*-------------------->>>>>>>*
} catch (final ChannelException c) { }
}
--------------------------------client----------------------------
Integer lockKey= getLockId();
boolean gotLock = false;
if (lockManager.lock(lockKey)) {
gotLock = true;
// other code lines
finally {
if (gotLock) {
lockManager.unlock(lockKey);
}
}
Refusing to release a lock would be a bug *if* the lock is really
owned by thread calling unblock().
If you have a use case which fails, I'd be hapy to look at it
Hi Bela
Thanks a lot for your quick reply.
We will change the .toString() implementation to use static text.
And yes we are calling unlock() always from finally after we
done with
locked resource.
Just to check again on unlockAll(), is it safe/guaranteed to
invoke to
release all locks associated
To given channel ?
Is there could be any reason where jGroup would just refuse to release
the lock ?
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 <tel:%2B65%206306%209062> (O)
-----Original Message-----
Sent: 20 September 2011 15:55
To: sujit kumar
Subject: Re: Setting Locking protocol
Does the toString() method of the object always resolve to the same string ?
I don't recommend this; it's better to pick a static lock name.
Also, you should call lock.unlock() in a finally clause.
Hi team
We are using jgroups-2.10.0.GA
<_http://jgroups-2.10.0.GA_><http://__jgroups-2.10.0.GA
<_http://jgroups-2.10.0.GA_>> for
distributed locking and even after calling unlock after each
successful call to lock() we hit error as "Unable to
unlock the
object" issue.
Any relevant detail will be a great help.
We are switching to jgroups-2.12.0.Final , please suggest
whether
unlockAll() will release all locks acquired by jGroup
smoothly and
would be safer option in case needed.
I have coded isLocked as following ..does this look fine?
*public**boolean* isLocked(*final* Object attr) {
Lock lock =/lockService/.getLock(attr.__toString());
*if* (lock.tryLock()) {
lock.unlock();
*return**false*;
}*else* {
*return**true*;
}
}
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
Bela Ban
2011-10-17 09:33:08 UTC
Permalink
If bind_addr=SITE_LOCAL cannot find a site local IP address, then
bind_addr will be null, resulting in the wildcard address 0.0.0.0 being
used.

There are many reasons why SITE_LOCAL doesn't find a suitable address, e.g.
- No valid address is available
- All relevant interfaces (NICs) are down
- You use IPv6 but have only IPv4 addresses, or vice versa
- You don't have site local addresses configured
Hi Bela
We got 4 environments with same config setup and jGroup version but in
one of our development environment we are consistently hitting following
issue.
java.lang.IllegalStateException: Queue full, cause: null [TCP]
TCP(bind_addr=SITE_LOCAL;bind_port=21200;port_range=5):FILE_PING(locatio
n=/app/log/dev/jgroupslockingcontrol;num_initial_members=1;num_ping_requ
ests=20):MERGE2(min_interval=500;max_interval=10000):FD_SOCK:FD(timeout=
2000;max_tries=4):VERIFY_SUSPECT(timeout=1500):BARRIER:pbcast.NAKACK(use
_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;dis
card_delivered_msgs=true):UNICAST(timeout=300,600,1200):pbcast.STABLE(st
ability_delay=1000;desired_avg_gossip=50000;max_bytes=400K):pbcast.GMS(p
rint_local_addr=true;join_timeout=3000;view_bundling=true):FC(max_credit
s=2M;min_threshold=0.10):FRAG2(frag_size=32767):pbcast.STREAMING_STATE_T
RANSFER:CENTRAL_LOCK
jGroup version: 2.12.0.Final
I doubt on SITE_LOCAL getting mapped to 0.0.0.0. Do you see something
wrong here?
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 (O)
-----Original Message-----
From: Kumar, Sujit
Sent: 20 September 2011 16:34
To: 'Bela Ban'; sujit kumar
Subject: RE: Setting Locking protocol
Hi Bela
Thanks a lot for your quick reply.
We will change the .toString() implementation to use static text.
And yes we are calling unlock() always from finally after we done with
locked resource.
Just to check again on unlockAll(), is it safe/guaranteed to invoke to
release all locks associated To given channel ?
Is there could be any reason where jGroup would just refuse to release
the lock ?
Thanks
Sujit
1 Serangoon North Ave 6(SIP)
+65 6306 9062 (O)
-----Original Message-----
Sent: 20 September 2011 15:55
To: sujit kumar
Subject: Re: Setting Locking protocol
Does the toString() method of the object always resolve to the same string ?
I don't recommend this; it's better to pick a static lock name.
Also, you should call lock.unlock() in a finally clause.
Post by sujit kumar
Hi team
We are using jgroups-2.10.0.GA<http://jgroups-2.10.0.GA> for
distributed locking and even after calling unlock after each
successful call to lock() we hit error as "Unable to unlock the
object" issue.
Post by sujit kumar
Any relevant detail will be a great help.
We are switching to jgroups-2.12.0.Final , please suggest whether
unlockAll() will release all locks acquired by jGroup smoothly and
would be safer option in case needed.
I have coded isLocked as following ..does this look fine?
*public**boolean* isLocked(*final* Object attr) {
Lock lock =/lockService/.getLock(attr.toString());
*if* (lock.tryLock()) {
lock.unlock();
*return**false*;
}*else* {
*return**true*;
}
}
--
Bela Ban
Lead JGroups / Clustering Team
JBoss
===============================================================================
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
===============================================================================
--
Bela Ban
Lead JGroups (http://www.jgroups.org)
JBoss / Red Hat
Loading...