Uploaded image for project: 'River (Retired)'
  1. River (Retired)
  2. RIVER-281

JERI MUX protocol hangs with com.sun.jini.jeri.connection.mux.server.initialInboundRation>=129280

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • jtsk_2.1
    • None
    • net_jini_jeri
    • None

    Description

      If a server is exported using a JERI TcpServerEndpoint, with the com.sun.jini.jeri.connection.mux.server.initialInboundRation system property set to 129280 or higher, a large inbound call hangs.

      Test code:

      package perfcompare;
      
      import java.rmi.Remote;
      import java.rmi.RemoteException;
      
      public interface DataSink extends Remote 
      {
          void transferChunk(byte[] data) throws RemoteException;
      }
      
      package perfcompare;
      
      import java.rmi.RemoteException;
      
      public class DataSinkImpl implements DataSink
      {
        public void transferChunk(byte[] data) throws RemoteException
        {
          System.out.println("received: " + data.length);
        }
      }
      
      package perfcompare;
      
      import java.io.FileOutputStream;
      import java.io.ObjectOutputStream;
      import java.net.InetAddress;
      import java.rmi.Remote;
      
      import net.jini.export.Exporter;
      import net.jini.jeri.BasicILFactory;
      import net.jini.jeri.BasicJeriExporter;
      import net.jini.jeri.tcp.TcpServerEndpoint;
      
      public class JeriServer
      {
        final static int SERVER_PORT = 8888;
        static Remote proxy;
      
        public static void main(String[] args)
        {
          // System.setProperty("com.sun.jini.jeri.tcp.useNIO", "true");
      
          DataSink impl = new DataSinkImpl();
          try
          {
            Exporter exporter = new BasicJeriExporter(
       
      TcpServerEndpoint.getInstance(InetAddress.getLocalHost().getHostAddress(
      ), SERVER_PORT ),
                new BasicILFactory(),
                false, // no DGC
                true   // keep this thread alive
            );
            proxy = exporter.export(impl);
      
            ObjectOutputStream ostream = new ObjectOutputStream(new
      FileOutputStream(Client.PROXYFILE));
            ostream.writeObject(proxy);
            System.out.println("proxy written to file " + Client.PROXYFILE);
            Thread.sleep(1000000);
          }
          catch (Exception e)
          {
            System.err.println("JeriServer failed: " + e);
          }
        }
      }
      
      package perfcompare;
      
      import java.io.FileInputStream;
      import java.io.ObjectInputStream;
      import java.util.Date;
      
      public class Client
      {
        public final static String PROXYFILE = "/tmp/HelloProxy";
        final static int chunkSize = 10 * 1000 * 1000;
        final static int count = 100 * 1;
      
        public static void main(String[] args)
        {   
          // System.setProperty("com.sun.jini.jeri.tcp.useNIO", "true");
          
          try
          {
            ObjectInputStream istream = new ObjectInputStream( new
      FileInputStream(PROXYFILE));
            DataSink proxy = (DataSink) istream.readObject();
            
            byte[] payload = new byte[chunkSize];
            System.out.println("Starting...");
            
            Date startTime = new Date();
            for (int i = 0; i < count; ++i)
            {
              System.out.println("chunk " + i);
              proxy.transferChunk(payload);
            }
            
            Date endTime = new Date();
      
            long elapsed = endTime.getTime() - startTime.getTime();
            long rate = chunkSize * count / elapsed ;
            System.out.println("Finished after " + elapsed + " msecs, " + rate
      + " KByte/sec");
          }
          catch (Exception e)
          {
            System.err.println("Client failed: " + e);
          }
        }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rscheifler Robert Scheifler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: