diff options
-rw-r--r-- | cppe/CHANGES | 17 | ||||
-rwxr-xr-x | cppe/src/IceE/Connection.cpp | 20 | ||||
-rw-r--r-- | cs/CHANGES | 68 | ||||
-rwxr-xr-x | cs/src/Ice/ConnectionI.cs | 20 | ||||
-rw-r--r-- | java/CHANGES | 25 | ||||
-rw-r--r-- | java/src/Ice/ConnectionI.java | 26 | ||||
-rwxr-xr-x | javae/CHANGES | 3 | ||||
-rw-r--r-- | javae/src/Ice/Connection.java | 26 |
8 files changed, 153 insertions, 52 deletions
diff --git a/cppe/CHANGES b/cppe/CHANGES index af5249eb269..29cd7ae2001 100644 --- a/cppe/CHANGES +++ b/cppe/CHANGES @@ -1,6 +1,9 @@ Changes since version 1.0.0 --------------------------- +- Connection::close(false) (i.e., graceful connection shutdown) now + waits until all outstanding requests have completed. + - Ice will now listen on all local interfaces if no -h parameter is present in the endpoint configuration and no default host has been set. It will also listen to all interfaces if the -h parameter @@ -8,14 +11,14 @@ Changes since version 1.0.0 in proxies will not contain the loopback interface (127.0.0.1) unless it is the only local interface present. -- slice2cppe now provides the --add-header option. It adds a #include directive - for the specified header at the beginning of the generated source file. For - example: +- slice2cppe now provides the --add-header option. It adds a #include + directive for the specified header at the beginning of the generated + source file. For example: slice2cppe --add-header=precompiled.h x.ice - adds "#include <precompiled.h> to the beginning of x.cpp (before any other - include directives). + adds "#include <precompiled.h> to the beginning of x.cpp (before any + other include directives). You can specify an optional guard, for example: @@ -28,8 +31,8 @@ Changes since version 1.0.0 #include <precompiled.h> #endif - You can repeat the --add-header option to include several headers - in the generated source. + You can repeat the --add-header option to include several headers in + the generated source. - Ice::Communicator::createObjectAdapter() throws Ice::AlreadyRegisteredException if it is called with the name of an diff --git a/cppe/src/IceE/Connection.cpp b/cppe/src/IceE/Connection.cpp index 006406e0115..afe4a5210dd 100755 --- a/cppe/src/IceE/Connection.cpp +++ b/cppe/src/IceE/Connection.cpp @@ -119,6 +119,26 @@ Ice::Connection::close(bool force) } else { + // + // If we do a graceful shutdown, then we wait until all + // outstanding requests have been completed. Otherwise, the + // CloseConnectionException will cause all outstanding + // requests to be retried, regardless of whether the server + // has processed them or not. + // + // For consistency, we also wait until batch requests have + // completed, and, if this is a server connection, all + // requests have been dispatched. These are the same criteria + // that we use to determine whether ACM may close this + // connection. + // + while(!_requests.empty() || + _batchStreamInUse || !_batchStream.b.empty() || + _dispatchCount != 0) + { + wait(); + } + setState(StateClosing, CloseConnectionException(__FILE__, __LINE__)); } } diff --git a/cs/CHANGES b/cs/CHANGES index 04c44ca7933..efa9830a7d3 100644 --- a/cs/CHANGES +++ b/cs/CHANGES @@ -13,28 +13,27 @@ Changes since version 2.1.2 custom logger is used to record any errors during communicator initialization. -- Ice will now listen on all local interfaces if no -h parameter - is present in the endpoint configuration and no default host has - been set. It will also listen to all interfaces if the -h parameter - is set to 0.0.0.0. In such configurations the endpoints published - in proxies will not contain the loopback interface (127.0.0.1) - unless it is the only local interface present. +- Ice will now listen on all local interfaces if no -h parameter is + present in the endpoint configuration and no default host has been + set. It will also listen to all interfaces if the -h parameter is + set to 0.0.0.0. In such configurations the endpoints published in + proxies will not contain the loopback interface (127.0.0.1) unless + it is the only local interface present. -- The Equals method for Slice structures that are mapped - to classes now returns false if the two structures being - compared are not of the same type. +- The Equals method for Slice structures that are mapped to classes + now returns false if the two structures being compared are not of + the same type. Previously, a comparison such as derived.Equals(base) - returned true if the base of part of derived was - the same as base; with the new slice2cs compiler, this - comparison returns false. + returned true if the base of part of derived was the same as base; + with the new slice2cs compiler, this comparison returns false. -- The Slice mapping for sequences has been improved. The - generated sequence class now contains the following additional - properties and methods: +- The Slice mapping for sequences has been improved. The generated + sequence class now contains the following additional properties and + methods: - Capacity - TrimToSize @@ -48,10 +47,10 @@ Changes since version 2.1.2 - LastIndexOf - Repeat - These have the same semantics as the corresponding methods - on System.Collections.ArrayList, with one exception: GetRange - returns a true copy of the requested range instead of returning - a view of a sub-section of the collection. + These have the same semantics as the corresponding methods on + System.Collections.ArrayList, with one exception: GetRange returns a + true copy of the requested range instead of returning a view of a + sub-section of the collection. - The Ice run-time libraries are now marked as CLS-compliant assemblies. In addition, the generated code is now also @@ -59,8 +58,8 @@ Changes since version 2.1.2 This involves one change to the C# language mapping: - The skeleton class used be called _<interface-name>Disp but - is now called <interface-name>Disp_. + The skeleton class used be called _<interface-name>Disp but is now + called <interface-name>Disp_. For example, if you previously had: @@ -70,8 +69,8 @@ Changes since version 2.1.2 class MyIntfI : MyIntfDisp_ { /* ... */ } - Similarly, for the Tie mapping, the location of the underscore - has changed: + Similarly, for the Tie mapping, the location of the underscore has + changed: _MyIntfTie -> MyIntfTie_ @@ -79,25 +78,26 @@ Changes since version 2.1.2 - Changed the way servant locators work if a server has a servant locator registered for a specific category, in addition to a default - servant locator. Previously, if the locator for the specific category - failed to locate the servant, the run time would then call the default - locator. With the new behavior, if the locator for the specific category - does not return a servant, the default locator is not called. + servant locator. Previously, if the locator for the specific + category failed to locate the servant, the run time would then call + the default locator. With the new behavior, if the locator for the + specific category does not return a servant, the default locator is + not called. - slice2cs now supports a new metadata directive: ["cs:attribute"]. - This directive allows you to inject C# attribute definitions into the - generated code. See the C# mapping chapter in the Ice manual for + This directive allows you to inject C# attribute definitions into + the generated code. See the C# mapping chapter in the Ice manual for more information. - Ice.Communicator.createObjectAdapter() throws Ice.AlreadyRegisteredException if it is called with the name of an object adapter that already exists. -- The "cs:" metadata prefix has been replaced by the "clr:" prefix, - so you now need to use "clr:collection" and "clr:class". - The "cs:" prefix is still recognized and acted upon; slice2cs - emits a warning for the old prefix. Two releases from now, the - warning will become a hard error and "cs:" will no longer work. +- The "cs:" metadata prefix has been replaced by the "clr:" prefix, so + you now need to use "clr:collection" and "clr:class". The "cs:" + prefix is still recognized and acted upon; slice2cs emits a warning + for the old prefix. Two releases from now, the warning will become a + hard error and "cs:" will no longer work. - Fixed a bug in the slice2cs code generator: for sequences of Slice structs that used the class mapping, the generated code caused a diff --git a/cs/src/Ice/ConnectionI.cs b/cs/src/Ice/ConnectionI.cs index d5b87a4c14b..701d5f9ef59 100755 --- a/cs/src/Ice/ConnectionI.cs +++ b/cs/src/Ice/ConnectionI.cs @@ -246,6 +246,26 @@ namespace Ice } else { + // + // If we do a graceful shutdown, then we wait until all + // outstanding requests have been completed. Otherwise, + // the CloseConnectionException will cause all outstanding + // requests to be retried, regardless of whether the + // server has processed them or not. + // + // For consistency, we also wait until batch requests have + // completed, and, if this is a server connection, all + // requests have been dispatched. These are the same + // criteria that we use to determine whether ACM may close + // this connection. + // + while(_requests.Count != 0 || _asyncRequests.Count != 0 || + _batchStreamInUse || !_batchStream.isEmpty() || + _dispatchCount != 0) + { + Monitor.Wait(this); + } + setState(StateClosing, new CloseConnectionException()); } } diff --git a/java/CHANGES b/java/CHANGES index eae63794375..a5e6913fe10 100644 --- a/java/CHANGES +++ b/java/CHANGES @@ -1,6 +1,9 @@ Changes since version 2.1.2 --------------------------- +- Connection::close(false) (i.e., graceful connection shutdown) now + waits until all outstanding requests have completed. + - Added a new object adapter property, <adapter>.ReplicaGroupId, which allows adapters to be replicated. See the IceGrid chapter in the manual for more information. @@ -13,18 +16,18 @@ Changes since version 2.1.2 custom logger is used to record any errors during communicator initialization. -- Ice will now listen on all local interfaces if no -h parameter - is present in the endpoint configuration and no default host has - been set. It will also listen to all interfaces if the -h parameter - is set to 0.0.0.0. In such configurations the endpoints published - in proxies will not contain the loopback interface (127.0.0.1) - unless it is the only local interface present. +- Ice will now listen on all local interfaces if no -h parameter is + present in the endpoint configuration and no default host has been + set. It will also listen to all interfaces if the -h parameter is + set to 0.0.0.0. In such configurations the endpoints published in + proxies will not contain the loopback interface (127.0.0.1) unless + it is the only local interface present. - The Freeze implementation now uses the new BerkeleyDB Java API introduced in version 4.3. BerkeleyDB 4.2 is no longer supported. -- The mapping for structures has changed: the clone() method now - has an empty exception specification; previously, it could throw +- The mapping for structures has changed: the clone() method now has + an empty exception specification; previously, it could throw java.lang.CloneNotSupportedException. - Changed the way servant locators work if a server has a servant @@ -52,9 +55,9 @@ Changes since version 2.1.2 communicator to stringify a proxy that way. - Parsing a stringified proxy no longer completely fails if the proxy - contains an endpoint type that is unknown to the Ice runtime as - long as the proxy contains other endpoints that are known. A warning - is printed for the unknown types that are encountered. + contains an endpoint type that is unknown to the Ice runtime as long + as the proxy contains other endpoints that are known. A warning is + printed for the unknown types that are encountered. - Ice.ObjectImpl is now an abstract class that cannot be instantiated. This change should be transparent to application code. diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java index 0cc19e74530..18fc01d28eb 100644 --- a/java/src/Ice/ConnectionI.java +++ b/java/src/Ice/ConnectionI.java @@ -244,6 +244,32 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } else { + // + // If we do a graceful shutdown, then we wait until all + // outstanding requests have been completed. Otherwise, + // the CloseConnectionException will cause all outstanding + // requests to be retried, regardless of whether the + // server has processed them or not. + // + // For consistency, we also wait until batch requests have + // completed, and, if this is a server connection, all + // requests have been dispatched. These are the same + // criteria that we use to determine whether ACM may close + // this connection. + // + while(!_requests.isEmpty() || !_asyncRequests.isEmpty() || + _batchStreamInUse || !_batchStream.isEmpty() || + _dispatchCount != 0) + { + try + { + wait(); + } + catch(InterruptedException ex) + { + } + } + setState(StateClosing, new CloseConnectionException()); } } diff --git a/javae/CHANGES b/javae/CHANGES index df75bfec079..1ccf4e5d819 100755 --- a/javae/CHANGES +++ b/javae/CHANGES @@ -1,6 +1,9 @@ Changes since version 1.0.0
---------------------------
+- Connection::close(false) (i.e., graceful connection shutdown) now
+ waits until all outstanding requests have completed.
+
- Ice.Communicator.createObjectAdapter() throws
Ice.AlreadyRegisteredException if it is called with the name of an
object adapter that already exists.
diff --git a/javae/src/Ice/Connection.java b/javae/src/Ice/Connection.java index ecfa50caaa4..13228b1f8f5 100644 --- a/javae/src/Ice/Connection.java +++ b/javae/src/Ice/Connection.java @@ -81,6 +81,32 @@ public final class Connection } else { + // + // If we do a graceful shutdown, then we wait until all + // outstanding requests have been completed. Otherwise, + // the CloseConnectionException will cause all outstanding + // requests to be retried, regardless of whether the + // server has processed them or not. + // + // For consistency, we also wait until batch requests have + // completed, and, if this is a server connection, all + // requests have been dispatched. These are the same + // criteria that we use to determine whether ACM may close + // this connection. + // + while(!_requests.isEmpty() || + _batchStreamInUse || !_batchStream.isEmpty() || + _dispatchCount != 0) + { + try + { + wait(); + } + catch(InterruptedException ex) + { + } + } + setState(StateClosing, new CloseConnectionException()); } } |