[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/multiplex ...

Ron Sigal ron_sigal at yahoo.com
Sat Aug 12 19:26:01 EDT 2006


  User: rsigal  
  Date: 06/08/12 19:26:01

  Modified:    src/main/org/jboss/remoting/transport/multiplex  
                        MultiplexServerInvoker.java OutputMultiplexor.java
  Log:
  JBREM-577:  Some additional logging has been added, as well as other temporary changes, in an attempt to track down the problem described in this JIRA issue.
  
  Revision  Changes    Path
  1.56      +41 -18    JBossRemoting/src/main/org/jboss/remoting/transport/multiplex/MultiplexServerInvoker.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MultiplexServerInvoker.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/multiplex/MultiplexServerInvoker.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -b -r1.55 -r1.56
  --- MultiplexServerInvoker.java	9 Aug 2006 19:46:48 -0000	1.55
  +++ MultiplexServerInvoker.java	12 Aug 2006 23:26:00 -0000	1.56
  @@ -195,7 +195,8 @@
      public MultiplexServerInvoker(InvokerLocator locator)
      {
         super(locator);
  -      virtualServerInvokers = Collections.synchronizedMap(new HashMap());
  +//      virtualServerInvokers = "stopped callback Connector"(new HashMap());
  +      virtualServerInvokers = new HashMap();
      }
   
      
  @@ -209,7 +210,8 @@
      public MultiplexServerInvoker(InvokerLocator locator, Map configuration) throws IOException
      {
         super(locator, configuration);
  -      virtualServerInvokers = Collections.synchronizedMap(new HashMap());
  +//      virtualServerInvokers = Collections.synchronizedMap(new HashMap());
  +      virtualServerInvokers = new HashMap();
      }
   
      
  @@ -295,7 +297,7 @@
               if ("Socket is closed".equals(e.getMessage())
                     || "Socket closed".equals(e.getMessage()))
               {
  -               log.debug("socket is closed: stopping thread");
  +               log.info("socket is closed: stopping thread");
                  // If this invoker was started by a Connector, let the Connector stop it.
                  if (hasMaster) 
                     stop();
  @@ -310,7 +312,7 @@
                  return;
               }
               else
  -               log.debug(e);
  +               log.info(e);
            }
            catch (SocketTimeoutException e)
            {
  @@ -320,7 +322,7 @@
                  // have shutdown, it's safe to stop.
                  if (connectPrimingSocket != null && ((VirtualSocket)connectPrimingSocket).hasReceivedDisconnectMessage())
                  {
  -                  log.debug("Client has closed: stopping thread");
  +                  log.info("Client has closed: stopping thread");
                     // If this invoker was started by a Connector, let the Connector stop it.
                     if (hasMaster)
                        stop();
  @@ -355,7 +357,7 @@
                  }
               }
               else
  -            	log.debug(ex);
  +            	log.info(ex);
            }
         }
         thread.interrupt();
  @@ -383,6 +385,7 @@
      
      public void stop()
      {
  +      log.info("entering stop()");
         // If running == false, super.stop() will not call cleanup().
         // However, MultiplexServerInvoker could have stuff to clean up
         // (socket group information) even if it didn't start.
  @@ -660,7 +663,10 @@
            si.setMBeanServer(this.getMBeanServer());
            si.setServerSocketFactory(this.getServerSocketFactory());
            si.setSocketFactory(this.socketFactory);
  +         synchronized (virtualServerInvokers)
  +         {
            virtualServerInvokers.put(socket.getRemoteSocketAddress(), si);
  +         }
            si.create();
            si.start();
            log.debug("created virtual MultiplexServerInvoker: " + si);
  @@ -670,7 +676,8 @@
     
      protected void cleanup()
      {
  -      log.debug("entering MultiplexServerInvoker.cleanup(): " + this);
  +      // temporary:
  +      log.info("entering MultiplexServerInvoker.cleanup(): " + this);
         
         // If running == false, SocketServerInvoker doesn't want to call cleanup().
         if (running)
  @@ -686,18 +693,23 @@
         
         if (isVirtual)
         {    
  +         log.info("is virtual");
            if (connectPrimingSocket != null)
            {
  +            log.info("connect priming != null");
               // If !virtualServerInvokers.containsKey(connectPrimingSocket.getRemoteSocketAddress()),
               // the master MultiplexServerInvoker might be iterating through virtualServerInvokers
               // and shutting them down.  This test avoids a NullPointerException.
               Object key = connectPrimingSocket.getRemoteSocketAddress();
  +            synchronized (virtualServerInvokers)
  +            {
               if (virtualServerInvokers.containsKey(key))
                  virtualServerInvokers.remove(key);
  +            }
   
               try
               {
  -               log.debug("MultiplexServerInvoker: closing connect priming socket");
  +               log.info("MultiplexServerInvoker: closing connect priming socket");
                  connectPrimingSocket.close();
               }
               catch (IOException e)
  @@ -715,6 +727,7 @@
            
            if (it.hasNext())
            {
  +            log.info("removing callback handlers");
               ServerInvocationHandler defaultHandler = (ServerInvocationHandler) it.next();
               ServerInvocationHandler handler = null;
               ServerInvokerCallbackHandler callbackHandler = null;
  @@ -736,8 +749,13 @@
         }
         else
         {
  +         log.info("is master");
   //         Iterator it = virtualServerInvokers.values().iterator();
  -         Iterator it = new HashMap(virtualServerInvokers).values().iterator();
  +         Iterator it = null;
  +         synchronized (virtualServerInvokers)
  +         {
  +            it = new HashMap(virtualServerInvokers).values().iterator();
  +         }
            
            while (it.hasNext())
            {
  @@ -756,7 +774,7 @@
               
               if (socketGroupInfo.getClientInvokers().isEmpty())
               {
  -               log.debug("invoker group shutting down: " + socketGroupInfo.getSocketGroupId());
  +               log.info("invoker group shutting down: " + socketGroupInfo.getSocketGroupId());
                  
                  if ((ps = socketGroupInfo.getPrimingSocket()) != null)
                  {
  @@ -767,7 +785,7 @@
                     // not be reused by any other socket group.
                     ps.getManager().unregisterShareable();
                     
  -                  log.debug("MultiplexServerInvoker: closing bind priming socket");
  +                  log.info("MultiplexServerInvoker: closing bind priming socket");
                     try
                     {
                        ps.close();
  @@ -1069,8 +1087,11 @@
    */
      public MultiplexServerInvoker getServerInvoker(InetSocketAddress address)
      {
  +      synchronized (virtualServerInvokers)
  +      {
         return (MultiplexServerInvoker) virtualServerInvokers.get(address);
      }
  +   }
      
      
   /**
  @@ -1080,9 +1101,11 @@
    */
      public Collection getServerInvokers()
      {
  +      synchronized (virtualServerInvokers)
  +      {
         return virtualServerInvokers.values();
      }
  -   
  +   }
      
   /**
    * 
  
  
  
  1.30      +2 -0      JBossRemoting/src/main/org/jboss/remoting/transport/multiplex/OutputMultiplexor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: OutputMultiplexor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/multiplex/OutputMultiplexor.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -b -r1.29 -r1.30
  --- OutputMultiplexor.java	23 Jul 2006 03:37:11 -0000	1.29
  +++ OutputMultiplexor.java	12 Aug 2006 23:26:00 -0000	1.30
  @@ -241,6 +241,8 @@
            if (writeQueue == null)
            {
               log.error("unregistered client: " + manager);
  +            // temporary:
  +            new Exception().printStackTrace();
               return;
            }
            
  
  
  



More information about the jboss-cvs-commits mailing list