You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@river.apache.org by Peter Jones <pe...@sun.com> on 2008/04/22 17:15:34 UTC

Re: svn commit: r650114 - in /incubator/river/jtsk/trunk/src/com/sun/jini: mahalo/TxnManagerImpl.java mercury/MailboxImpl.java mercury/RemoteEventDataCursor.java mercury/package.html

Robert,

It looks like the license headers for these two files got accidentally
changed with this commit:

incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java
incubator/river/jtsk/trunk/src/com/sun/jini/mercury/package.html

-- Peter


On Mon, Apr 21, 2008 at 11:54:48AM +0000, resendes@apache.org wrote:
> Author: resendes
> Date: Mon Apr 21 04:54:44 2008
> New Revision: 650114
> 
> URL: http://svn.apache.org/viewvc?rev=650114&view=rev
> Log:
> Fixes for RIVER-206, RIVER-241 and RIVER-247
> 
> Modified:
>     incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java
>     incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java
>     incubator/river/jtsk/trunk/src/com/sun/jini/mercury/RemoteEventDataCursor.java
>     incubator/river/jtsk/trunk/src/com/sun/jini/mercury/package.html
> 
> Modified: incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java
> URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java?rev=650114&r1=650113&r2=650114&view=diff
> ==============================================================================
> --- incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java (original)
> +++ incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerImpl.java Mon Apr 21 04:54:44 2008
> @@ -131,7 +131,7 @@
>  
>      private transient int taskthreads = 50;
>      private transient long tasktimeout = 1000 * 15;
> -    private transient float taskload = 3.0f;
> +    private transient float taskload = 1.0f;
>  
>  
>      /* Its important here to schedule SettlerTasks on a */
> 
> Modified: incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java
> URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java?rev=650114&r1=650113&r2=650114&view=diff
> ==============================================================================
> --- incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java (original)
> +++ incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java Mon Apr 21 04:54:44 2008
> @@ -1,19 +1,19 @@
>  /*
> - * Licensed to the Apache Software Foundation (ASF) under one
> - * or more contributor license agreements.  See the NOTICE file
> - * distributed with this work for additional information
> - * regarding copyright ownership. The ASF licenses this file
> - * to you under the Apache License, Version 2.0 (the
> - * "License"); you may not use this file except in compliance
> - * with the License. You may obtain a copy of the License at
>   * 
> - *      http://www.apache.org/licenses/LICENSE-2.0
> + * Copyright 2005 Sun Microsystems, Inc.
> + * 
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at
> + * 
> + * 	http://www.apache.org/licenses/LICENSE-2.0
>   * 
>   * Unless required by applicable law or agreed to in writing, software
>   * distributed under the License is distributed on an "AS IS" BASIS,
>   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>   * See the License for the specific language governing permissions and
>   * limitations under the License.
> + * 
>   */
>  package com.sun.jini.mercury;
>  
> @@ -448,6 +448,18 @@
>       * The variable is guarded by <code>destroyLock</code>.
>       */
>      private boolean destroySucceeded = false;
> +
> +    /**
> +     * When destroying the space, how long to wait for a clean
> +     * unexport (which allows the destroy call to return) before
> +     * giving up calling <code>unexport(true)</code>
> +     */
> +    private long maxUnexportDelay;
> +
> +    /**
> +     * Length of time to sleep between unexport attempts
> +     */
> +    private long unexportRetryDelay;
>      
>      /** 
>       * Object used to prevent access to this service during the service's
> @@ -845,6 +857,12 @@
>  	    // Start snapshot thread
>  	    snapshotter = new SnapshotThread();
>  	}
> +        
> +	maxUnexportDelay = Config.getLongEntry(config, MERCURY, 
> +	    "maxUnexportDelay", 2 * MINUTES, 0, Long.MAX_VALUE);
> +
> +	unexportRetryDelay = Config.getLongEntry(config, MERCURY, 
> +	    "unexportRetryDelay", SECONDS, 1, Long.MAX_VALUE);
>  
>          // Start threads
>  	notifier = new Notifier(config);
> @@ -2465,7 +2483,7 @@
>                          }                
>                      }
>                  }
> -                 /* If no events currently availalbe, wait up to timeout and try
> +                 /* If no events currently available, wait up to timeout and try
>                   * again.
>                   * Note: wait(0) means wait until notified (i.e. forever) 
>                   */
> @@ -3229,9 +3247,6 @@
>       */
>      private class DestroyThread extends Thread {
>  
> -        /** Maximum delay for unexport attempts */
> -        private static final long MAX_UNEXPORT_DELAY = 2 * MINUTES;
> -
>  	/** Create a non-daemon thread */
>  	public DestroyThread() {
>  	    super("DestroyThread");
> @@ -3284,9 +3299,8 @@
>     		    }
>     	        }
>                  
> -
> -                long endTime =
> -                    System.currentTimeMillis() + MAX_UNEXPORT_DELAY;
> +                long now = System.currentTimeMillis();
> +                long endTime = now + maxUnexportDelay;
>                  if (endTime < 0) { // Check for overflow
>                      endTime = Long.MAX_VALUE;
>                  }
> @@ -3294,19 +3308,31 @@
>  /**TODO 
>    * - trap IllegalStateException from unexport
>    */
> -                while ((!unexported) &&
> -                       (System.currentTimeMillis() < endTime))
> -                {
> +                while ((!unexported) && (now < endTime)) {
>                      /* wait for any pending operations to complete */
> -                    unexported =
> -                        exporter.unexport(false);
> +                    unexported = exporter.unexport(false);
>                      if (!unexported) {
>                          if (adminLogger.isLoggable(Level.FINEST)) {
>                              adminLogger.log(Level.FINEST, 
>                                  "Waiting for in-progress calls to complete");
>                          }
>                          try {
> -                            sleep(1000);
> + 			    /* Sleep for a finite time instead of yield.
> +			     * In most VMs yield is a no-op so if 
> +			     * unexport(false) is not working (say because
> +			     * there is a blocking query in progress) a
> +			     * yield here results in a very tight loop
> +			     * (plus there may be no other runnable threads)
> +			     */
> +			    final long sleepTime = 
> +				Math.min(unexportRetryDelay, endTime - now);
> +
> +			    /* sleepTime must > 0, unexportRetryDelay is
> +			     * > 0 and if now >= end_time we would have
> +			     * fallen out of the loop
> +			     */
> +			    sleep(sleepTime);
> +			    now = System.currentTimeMillis();    
>                          } catch (InterruptedException ie) {
>                              if (adminLogger.isLoggable(Levels.HANDLED)) {
>                                  adminLogger.log(Levels.HANDLED, 
> 
> Modified: incubator/river/jtsk/trunk/src/com/sun/jini/mercury/RemoteEventDataCursor.java
> URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/mercury/RemoteEventDataCursor.java?rev=650114&r1=650113&r2=650114&view=diff
> ==============================================================================
> --- incubator/river/jtsk/trunk/src/com/sun/jini/mercury/RemoteEventDataCursor.java (original)
> +++ incubator/river/jtsk/trunk/src/com/sun/jini/mercury/RemoteEventDataCursor.java Mon Apr 21 04:54:44 2008
> @@ -19,9 +19,9 @@
>  
>  import java.io.Serializable;
>  /**
> - * Trival class (struct) that simply holds the current read count
> + * Trivial class (struct) that simply holds the current read count
>   * and the associated (next unread) read position. U?sed as the client-side
> - * cookie for PersistentLog.
> + * cookie for PersistentEventLog.
>   * @since 2.1
>   */
>  class RemoteEventDataCursor implements Serializable {
> 
> Modified: incubator/river/jtsk/trunk/src/com/sun/jini/mercury/package.html
> URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/mercury/package.html?rev=650114&r1=650113&r2=650114&view=diff
> ==============================================================================
> --- incubator/river/jtsk/trunk/src/com/sun/jini/mercury/package.html (original)
> +++ incubator/river/jtsk/trunk/src/com/sun/jini/mercury/package.html Mon Apr 21 04:54:44 2008
> @@ -1,19 +1,9 @@
>  <!--
> - ! Licensed to the Apache Software Foundation (ASF) under one
> - ! or more contributor license agreements.  See the NOTICE file
> - ! distributed with this work for additional information
> - ! regarding copyright ownership. The ASF licenses this file
> - ! to you under the Apache License, Version 2.0 (the
> - ! "License"); you may not use this file except in compliance
> - ! with the License. You may obtain a copy of the License at
>   ! 
> - !      http://www.apache.org/licenses/LICENSE-2.0
> + ! Copyright 2005, Sun Microsystems, Inc.
> + ! Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">
> + ! Apache License, Version 2.0</a>.
>   ! 
> - ! Unless required by applicable law or agreed to in writing, software
> - ! distributed under the License is distributed on an "AS IS" BASIS,
> - ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> - ! See the License for the specific language governing permissions and
> - ! limitations under the License.
>   !-->
>  
>  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
> @@ -43,7 +33,7 @@
>  
>  <p>
>  The JAR file <code>mercury.jar</code>, included in the <code>lib</code>
> -subdirectory of the Apache River release
> +subdirectory of the Jini(TM) Technology Starter Kit (starter kit)
>  installation, contains the classes for the three Mercury service
>  implementations. The <code>mercury-dl.jar</code> 
>  and <code>jsk-dl.jar</code> files in the <code>lib-dl</code> subdirectory
> @@ -373,6 +363,42 @@
>        obtained at service start and restart. This entry is only used by
>        persistent implementations.
>    </table>
> +  
> +<a name="maxUnexportDelay"></a>
> +<table summary="Describes the maxUnexportDelay configuration entry"
> +	 border="0" cellpadding="2">
> +    <tr valign="top">
> +      <th scope="col" summary="layout"> <font size="+1">&#X2022;</font>
> +      <th scope="col" align="left" colspan="2"> <font size="+1">
> +      <code>maxUnexportDelay</code></font>
> +    <tr valign="top"> <td> &nbsp <th scope="row" align="right">
> +      Type: <td> <code>long</code>
> +    <tr valign="top"> <td> &nbsp <th scope="row" align="right">
> +      Default: <td> <code>120000</code> (2 minutes)
> +    <tr valign="top"> <td> &nbsp <th scope="row" align="right">
> +
> +      Description: <td> How long to retry &#147nice&#148 unexport attempts before
> +      forcing the unexport. Part of destroying a Mercury server includes
> +      calling {@link net.jini.export.Exporter#unexport
> +      Exporter.unexport(boolean force)} on the <code>Exporter</code> used
> +      to export the server (see
> +      <a href="#serverExporter"><code>serverExporter</code></a>). The initial
> +      <code>unexport</code> call passes <code>false</code> for the value of
> +      the <code>force</code> parameter. This is done in order to allow the
> +      destroy call to return cleanly to the client. If the initial
> +      <code>unexport</code> call fails, Mercury will retry calling
> +      <code>unexport(false)</code> for up to <code>maxUnexportDelay</code>
> +      milliseconds before giving up and calling
> +      <code>unexport(true)</code>.  <code>maxUnexportDelay</code> must be a
> +      non-negative long value. If <code>maxUnexportDelay</code> is zero
> +      then the very first call to <code>unexport</code> passes
> +      <code>true</code> for the value of the <code>force</code> parameter,
> +      no nice unexport attempt is made. Obtained at service start and
> +      restart. Note, the delay between attempted <code>unexport</code>
> +      calls is controlled by the <a
> +      href="#unexportRetryDelay"><code>unexportRetryDelay</code></a>
> +      configuration entry.
> +</table>
>  
>  <a name="notificationsTaskManager"></a>
>  <table summary="Describes the notificationsTaskManager configuration entry"
> @@ -480,7 +506,7 @@
>        prepared by this preparer until they are being recovered.
>    </table>
>  
> -
> +<a name="serverExporter"></a>
>    <table summary="Describes the serverExporter configuration entry"
>           border="0" cellpadding="2">
>      <tr valign="top">
> @@ -509,7 +535,30 @@
>        the call to <code>getEntry</code> will supply the activation ID in
>        the <code>data</code> argument. This entry is obtained at service
>        start and restart.
> -  </table> <p>
> +  </table>
> +  
> +<a name="unexportRetryDelay"></a>
> +<table summary="Describes the unexportRetryDelay configuration entry"
> +	 border="0" cellpadding="2">
> +    <tr valign="top">
> +      <th scope="col" summary="layout"> <font size="+1">&#X2022;</font>
> +      <th scope="col" align="left" colspan="2"> <font size="+1">
> +      <code>unexportRetryDelay</code></font>
> +    <tr valign="top"> <td> &nbsp <th scope="row" align="right">
> +      Type: <td> <code>long</code>
> +    <tr valign="top"> <td> &nbsp <th scope="row" align="right">
> +      Default: <td> <code>1000</code> (1 second)
> +    <tr valign="top"> <td> &nbsp <th scope="row" align="right">
> +
> +      Description: <td> When destroying a Mercury server how long to
> +      wait between unexport attempts. <code>unexportRetryDelay</code> must
> +      be a positive long value. When destroying itself Mercury will sleep
> +      for <code>unexportRetryDelay</code> milliseconds between {@link
> +      net.jini.export.Exporter#unexport Exporter.unexport} calls. Obtained
> +      at service start and restart. See <a
> +      href="#maxUnexportDelay"><code>maxUnexportDelay</code></a> for
> +      additional details.
> +  </table> <P>
>  
>  <a name="access_control">
>  <h2>Access Control Permission Targets</h2>
> @@ -808,7 +857,7 @@
>       <li> <a href="#persistent_jrmp">Persistent</a>
>       <li> <a href="#activatable_jrmp">Activatable</a>
>       </ul>
> -<li> Jini extensible remote invocation (Jini ERI) configurations
> +<li> Jini(TM) extensible remote invocation (Jini ERI) configurations
>       <ul>
>       <li> <a href="#transient">Transient</a>
>       <li> <a href="#persistent">Persistent</a>
> @@ -826,7 +875,7 @@
>  <ul>
>  <li> The Java(TM) 2 Platform, Standard Edition, (J2SE(TM)) has been
>       installed, and its commands are available in the current path
> -<li> The Apache River release has been installed in the
> +<li> The starter kit has been installed in the
>       <var><b>install_dir</b></var> directory
>  <li> The example configuration and policy files described below are
>       available in the <var><b>config_dir</b></var> directory
> @@ -876,7 +925,7 @@
>  
>  Use this security policy file for starting and running all Mercury
>  configurations. This file grants all permissions to local code included
> -in the <code>lib</code> subdirectory of the Apache River release installation.<p>
> +in the <code>lib</code> subdirectory of the starter kit installation.<p>
>  
>  <blockquote>
>  <pre>
> 
> 

Re: svn commit: r650114 - in /incubator/river/jtsk/trunk/src/com/sun/jini: mahalo/TxnManagerImpl.java mercury/MailboxImpl.java mercury/RemoteEventDataCursor.java mercury/package.html

Posted by Robert Resendes <Ro...@Sun.COM>.
Peter Jones wrote:
> Robert,
> 
> It looks like the license headers for these two files got accidentally
> changed with this commit:
> 
> incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java
> incubator/river/jtsk/trunk/src/com/sun/jini/mercury/package.html
> 
Yup. Good catch. I'll file another bug to track it and should have the 
changes in shortly.

Bob