river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Scheifler (JIRA)" <j...@apache.org>
Subject [jira] Created: (RIVER-281) JERI MUX protocol hangs with com.sun.jini.jeri.connection.mux.server.initialInboundRation>=129280
Date Tue, 18 Dec 2007 23:11:42 GMT
JERI MUX protocol hangs with com.sun.jini.jeri.connection.mux.server.initialInboundRation>=129280
-------------------------------------------------------------------------------------------------

                 Key: RIVER-281
                 URL: https://issues.apache.org/jira/browse/RIVER-281
             Project: River
          Issue Type: Bug
          Components: net_jini_jeri
    Affects Versions: jtsk_2.1
            Reporter: Bob Scheifler
            Priority: Minor


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


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message