Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000307 [Resin] minor always 07-12-05 00:00 11-30-05 14:43
Reporter ferg View Status public  
Assigned To
Priority urgent Resolution fixed  
Status closed   Product Version 3.0.14
Summary 0000307: Resin Daemon enhancement
Description RSN-350
(rep by Fiaz Hossain)

 The problem with the current daemon mode is that there seems to be no way to shutdown the resin process. The only option is to be able to restart it which is not ideal. What I added was to flag to ResinServer to mark it for shutdown.
 
Additional Information
Attached Files

- Relationships

- Notes
(0000346)
ferg
07-12-05 00:00

1. Shutdown a Resin Daemon server. Priority - Very High. We have built a JMX based monitoring and management infrastructure that allows us to manage servers more effectively that wrapper.pl. We are basically running our servers in "daemon" mode as opposed to have the socket based shutdown mode that the wrapper.pl employs. This allows us to restart the monitor (wrapper.pl) without restarting the application server. The problem with the current daemon mode is that there seems to be no way to shutdown the resin process. The only option is to be able to restart it which is not ideal. What I added was to flag to ResinServer to mark it for shutdown.
 
File1 - com.caucho.server.resin.ResinServer.java.
 
+ private boolean _isClosingForShutdown;
 
+ /**
+ * Returns true if the server is closing for shutdown.
+ */
+ public boolean isClosingForShutdown()
+ {
+ return _isClosingForShutdown;
+ }
 
+ /**
+ * Set closing for shutdown.
+ */
+ public void setClosingForShutdown()
+ {
+ _isClosingForShutdown = true;
+ }
 
Also currently there is a race condition, where the server is marked _isClosed but not all close events have been called. This _isClosed is picked up by Resin.java that tries to shutdown the server when another thread calls closeEvent and tries to restart the server. The fix to the race condition is to change the finally of the destroy method to look like this:
 
    } finally {
        try {
            ArrayList<ResinServerListener> listeners = _listeners;
           
            for (int i = 0; i < listeners.size(); i++) {
                ResinServerListener listener = listeners.get(i);
   
                listener.closeEvent(this);
            }
        } finally {
            _isClosed = true;
        }
    }
 
File2 - com.caucho.server.resin.Resin.java
 
Original CloseEvent()
  public void closeEvent(ResinServer server)
  {
    try {
      if (_waitIn == null) {
            _isRestarting = true;
            _server = null;
 
            log.info("restarting Resin");
 
            init();
      }
      else
            _isClosed = true;
    } catch (Throwable e) {
      _isClosed = true;
      log.log(Level.WARNING, e.toString(), e);
    }
  }
 
Should be modified to include serveris.isClosingForShutdown() as shown below
 
  public void closeEvent(ResinServer server)
  {
    try {
      if (_waitIn == null) {
          if (server != null && !server.isClosingForShutdown()) {
            _isRestarting = true;
            _server = null;
 
            log.info("restarting Resin");
 
            init();
    _isRestarting = false;
          }
          // For the shutdown case there is nothing to do
      }
      else
            _isClosed = true;
    } catch (Throwable e) {
      _isClosed = true;
      log.log(Level.WARNING, e.toString(), e);
    }
  }
 
 
 
(0000347)
ferg
07-12-05 00:00

Using setRestartOnClose(boolean) as the attribute name.
 

- Issue History
Date Modified Username Field Change
07-12-05 00:00 ferg New Issue
11-30-05 00:00 administrator Fixed in Version  => 3.0.15
11-30-05 14:43 ferg Status resolved => closed


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker