-
Bug
-
Resolution: Done
-
Major
-
2.12.1
-
None
MuxRpcDispatcher alters RequestOption's filter by encapsulating it with a NoMuxHandlerRspFilter. Passing the same instance of RequestOptions to rpc calls leads to :
java.lang.StackOverflowError
at org.jgroups.blocks.mux.NoMuxHandlerRspFilter.isAcceptable(NoMuxHandlerRspFilter.java:24)
at org.jgroups.blocks.mux.NoMuxHandlerRspFilter.isAcceptable(NoMuxHandlerRspFilter.java:24)
.....
.....
Solutions :
1/ "Clone" RequestOption at each call like fix used in https://issues.jboss.org/browse/JGRP-1271. The drawback with this solution, is the performance concern : useless object creation if a RequestOption is reused.
2/ Don't encapsulate RequestOption if a NoMuxHandlerRspFilter is already setted. Modification concerns two classes :
- NoMuxHandlerRspFilter
private NoMuxHandlerRspFilter(RspFilter filter) { this.filter = filter; }
public static RspFilter createInstance(RspFilter filter) {
if (filter instanceof NoMuxHandlerRspFilter)
return new NoMuxHandlerRspFilter(filter) ;
}
- MuxRpcDispatcher
protected GroupRequest cast(Collection<Address> dests, Message msg, RequestOptions options, boolean blockForResults) { RspFilter filter = options.getRspFilter(); return super.cast(dests, msg, options.setRspFilter(NoMuxHandlerRspFilter.createInstance(filter)), blockForResults); }