[JBoss JIRA] Created: (JGRP-1276) JGroups ignores my custom SocketFactory
by Adrian Tarau (JIRA)
JGroups ignores my custom SocketFactory
---------------------------------------
Key: JGRP-1276
URL: https://issues.jboss.org/browse/JGRP-1276
Project: JGroups
Issue Type: Bug
Affects Versions: 2.10
Environment: All
Reporter: Adrian Tarau
Assignee: Bela Ban
I was trying to replace the default socket factory with my own socket factory so I can decide if MulticaseSocket is created with InetSocketAddress or to use just the port(to experiment this "Invalid argument") and it doesn't use my socket factory.
Looking in the code, the way(the call order) how the socket factory is forwarded to the protocols is wrong(I think) because the protocols are started with the default stack instead of my stack.
prot_stack.getTopProtocol().setSocketFactory(socket_factory) should be called before the stack is started and not after.
private void startStack(String cluster_name) throws ChannelException {
.....
try {
prot_stack.startStack(cluster_name, local_addr); // calls start() in all protocols, from top to bottom
}
catch(Throwable e) {
throw new ChannelException("failed to start protocol stack", e);
}
if(socket_factory != null) {
prot_stack.getTopProtocol().setSocketFactory(socket_factory);
}
....
}
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 3 months
[JBoss JIRA] Created: (JGRP-1278) LockService lock, tryLock methods don't work well with interrupt
by William Burns (JIRA)
LockService lock, tryLock methods don't work well with interrupt
----------------------------------------------------------------
Key: JGRP-1278
URL: https://issues.jboss.org/browse/JGRP-1278
Project: JGroups
Issue Type: Bug
Affects Versions: 2.12
Reporter: William Burns
Assignee: Bela Ban
I have been trying out the new LockService class, which has been great to use.
However I began looking into stuff around interrupts, and while glancing at the actual protocol code I became a little confused as to how the lock method would ignore an interrupt and still acquire the lock. So I wrote up a simple test case, which can be found in the Reproduce section.
Needless to say the lock method behaves completely differently than how I would have expected if an interrupt was encountered. If the interrupt flag is set the lock method would return immediately, making the caller think the lock was retrieved. However the lock was not retrieved! Also not to mention the interrupt status was lost completely, further preventing the interrupt from being checked in a later part of code.
Also the tryLock() method behaves somewhat in a similar fashion as lock. If the interrupt status is set it will return false immediately and clear the interrupt status. I would expect the code to still retrieve the lock if possible and leave the interrupt flag set afterwards just like I would in the case of lock.
I did also test the lockInterruptibly, tryLock(long, TimeUnit) and those worked if the interrupt flag was set before invoking it, by throwing an InterruptedException as expected.
I didn't test any of the methods in regards to an interrupt being done in the middle of waiting to acquire a lock.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 3 months
[JBoss JIRA] Created: (JGRP-1277) Usage of TimeUnit class is inverted, causing incorrect conversions between time units
by William Burns (JIRA)
Usage of TimeUnit class is inverted, causing incorrect conversions between time units
-------------------------------------------------------------------------------------
Key: JGRP-1277
URL: https://issues.jboss.org/browse/JGRP-1277
Project: JGroups
Issue Type: Bug
Affects Versions: 2.12
Reporter: William Burns
Assignee: Bela Ban
Priority: Minor
I have tried posting something to the blog at http://belaban.blogspot.com/2011/01/new-distributed-locking-service-in.html but it hasn't put up my comment yet, so I decided to create a JIRA as well.
I have taken the latest 2.12 build of Beta1 which includes the new LockService class. This class is so much of an improvement how the DistributedLockManager was; great work!
But anyways I found that when you try to acquire a lock with a wait, it is not converting the timeunits correctly unless it is in MILLISECONDS. This cannot be reproduced with the demo class since it always uses MILLISECONDS.
The code in question is found on the Locking$ClientLock inner class.
{code}
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
return acquireTryLock(unit.convert(time, TimeUnit.MILLISECONDS), true);
}
{code}
The way this is, the code will convert the time value passed in as MILLISECONDS to the passed in TimeUnit. This simply needs to change to make the TimeUnit.MILLISECONDS the object of which the convert method is being called on and having unit as the second argument.
{code}
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
return acquireTryLock(TimeUnit.MILLISECONDS.convert(time, unit), true);
}
{code}
This obviously has a simple workaround of _always_ passing in a TimeUnit of MILLISECONDS and having the time value already adjusted.
And again this new feature looks to be very promising.
Also when just checking the jgroups code base there are 3 other references to convert, 2 of which are also broken in this fashion.
{quote}
HashedTimingWheel.schedule
TimeScheduler2.schedule
{quote}
Both of these references in the jgroup code base are always passed MILLISECONDS, so it would only be seen if client code were to interact with them somehow.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 3 months
[JBoss JIRA] Resolved: (JBREM-159) Patch to enable JRockit 5.0 to work with JBoss Remoting
by Ron Sigal (JIRA)
[ https://issues.jboss.org/browse/JBREM-159?page=com.atlassian.jira.plugin.... ]
Ron Sigal resolved JBREM-159.
-----------------------------
Resolution: Out of Date
> Patch to enable JRockit 5.0 to work with JBoss Remoting
> -------------------------------------------------------
>
> Key: JBREM-159
> URL: https://issues.jboss.org/browse/JBREM-159
> Project: JBoss Remoting
> Issue Type: Patch
> Components: general
> Affects Versions: 2.2.2.GA
> Reporter: Jeff Haynie
> Priority: Minor
>
> org.jboss.remoting.detection.multicast.MulticaseDetector$Listener.run, changed:
> try
> {
> listen(p, buf);
> }
> catch (Exception ex)
> to:
> try
> {
> listen(p, buf);
> p.setLength(buf.length);
> }
> catch (Exception ex)
> org.jboss.remoting.loading.ClassUtil.serialize, changed body of the method from:
> java.io.ByteArrayOutputStream bos=new java.io.ByteArrayOutputStream();
> java.io.ObjectOutputStream oos=new java.io.ObjectOutputStream(bos);
> oos.writeObject(obj);
> oos.flush();
> bos.flush();
> byte buf[]=bos.toByteArray();
> bos=null;
> oos=null;
> return buf;
> to:
> java.io.ByteArrayOutputStream bos=new java.io.ByteArrayOutputStream();
> java.io.ObjectOutputStream oos=new java.io.ObjectOutputStream(bos);
> oos.writeObject(obj);
> oos.flush();
> bos.flush();
> oos.close();
> bos.close();
> byte buf[]=bos.toByteArray();
> bos=null;
> oos=null;
> return buf;
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 3 months