Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1369

MuxRpcDispatcher may encapsulate infinitely RequestOption's filter with NoMuxHandlerRspFilter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.12.2, 3.0
    • 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 filter; }

      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); }

              rhn-engineering-bban Bela Ban
              blcjgroups Benoit Leblanc (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: