maandag 19 november 2012

DMTCP and Java RMI (3)

I have continued my efforts on trying to get my application working with DMTCP checkpointing and restarting.
But to make things more clear we will start of with a complete description of  the test application.

RMI HellowordCounter

The layout is as follows:
  • HelloInterface.java
    public interface HelloInterface extends Remote {
     public String say() throws RemoteException;
    }
    
  • Hello.java
    public class Hello extends UnicastRemoteObject implements HelloInterface {
     private static final Logger LOG = Logger.getLogger("Hello");
     private static FileHandler logFileHandler;
    
     private static final long serialVersionUID = 1L;
     private String message;
     private static int counter = 0;
     
     public Hello (String msg) throws RemoteException {
      initLogging();
      message = msg;
     }
     
     public String say() throws RemoteException {
      counter++;
      LOG.info("Say :: " + message + counter);
      return message+counter;
     }
    }
    
  • HelloServer.java
    public class HelloServer 
    {
     public static void main (String[] argv) 
     {
      try {
       System.setProperty("java.rmi.server.codebase","http://myserver:9999/");
       System.setProperty("java.rmi.server.hostname", "myserver");
       Naming.rebind ("Hello", new Hello ("Hello,"));
       System.out.println ("Server is connected and ready for operation.");
      } 
      catch (Exception e) {
       System.out.println ("Server not connected: " + e);
      }
     }
    }
    
  • HelloClient.java
    public class HelloClient 
    {
     private static final Logger LOG = Logger.getLogger("HelloClient");
     private static FileHandler logFileHandler;
     
     public static void main (String[] argv) {
      try {
       initLogging();
       System.setProperty("java.rmi.server.hostname", "myserver");
       System.setProperty("java.rmi.server.codebase","http://myserver:9999/");
       
       
       HelloInterface hello =(HelloInterface) Naming.lookup ("rmi://myserver:1099/Hello");
       
       while (true) {
        Thread.sleep(1000);
        
        LOG.warning(hello.say());
       }
       
      } 
      catch (Exception e){
       System.out.println ("HelloClient exception: " + e);}
     }
    }
This application represents a simple helloworld application combined with a counter to make sure we have communication between the stub and the skeleton.

To run this we use an rmiregistry running on the system of the server and jar file containing the jini (apache river) classserver to perform remote classloading.

If we combine this with the dmtcp commands we get the following commands to be executed on the machine of the server:

  • dmtcp_coordinator : we start up the coordinator
  • dmtcp_checkpoint rmiregistry
  • dmtcp_checkpoint java -jar classserver.jar -trees -dir "/home/robin/RMITest/bin" -port 9999 -verbose
  • dmtcp_checkpoint java HelloServer

On the machine of the client :

  • dmtcp_checkpoint java HelloClient
All of these commands have been executed with DMTCP_HOST set as myserver which is the name given to the machine of the server.

To test everything in a more detailed manner, the dmtcp commands have been recompiled with debugging enabled. 

Afterwards I tried to execute the application with only the rmiregistry and the classserver run through dmtcp. 
The checkpointing now went successful as well as the restart. 
Executing rmiregistry, classserver and HelloServer through dmtcp resulted in an exception at the client side when checkpointing since dmtcp pauses the application when checkpointing. 

Executing the complete application with dmtcp made it impossible to restart the application. 
Some of the problems that arise have already been shown in my previous posts and I can now even add a new one that occurred just recently:


[2432] ERROR at connectionmanager.cpp:545 in KernelDeviceToConnection; REASON='JASSERT(device == fdToDevice ( fds[i] )) failed'
     device = pipe:[150039]
     fdToDevice ( fds[i] ) = pipe:[150040]
     fds[i] = 1
     fds[0] = 0
java (2432): Terminating...
[2456] ERROR at connectionmanager.cpp:545 in KernelDeviceToConnection; REASON='JASSERT(device == fdToDevice ( fds[i] )) failed'
     device = pipe:[26067]
     fdToDevice ( fds[i] ) = pipe:[26068]
     fds[i] = 1
     fds[0] = 0
java (2456): Terminating...
[2512] ERROR at connectionmanager.cpp:545 in KernelDeviceToConnection; REASON='JASSERT(device == fdToDevice ( fds[i] )) failed'
     device = pipe:[150039]
     fdToDevice ( fds[i] ) = pipe:[150040]
     fds[i] = 1
     fds[0] = 0
rmiregistry (2512): Terminating...
[2590] ERROR at connectionmanager.cpp:545 in KernelDeviceToConnection; REASON='JASSERT(device == fdToDevice ( fds[i] )) failed'
     device = pipe:[150039]
     fdToDevice ( fds[i] ) = pipe:[150040]
     fds[i] = 1
     fds[0] = 0
java (2590): Terminating...
Segmentation fault (core dumped)
Segmentation fault (core dumped)

This are just pieces of the complete output, but they clearly show the failure of starting up the application.

Geen opmerkingen:

Een reactie posten