summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-04-12 20:50:00 +0000
committerMark Spruiell <mes@zeroc.com>2005-04-12 20:50:00 +0000
commit3ac86ca67b43924dfddc0656f6d02b1d90f976b2 (patch)
tree37eebd9827ccc98fde9877a3e4f09f6f163daa5d /java/src
parentfixing typo (diff)
downloadice-3ac86ca67b43924dfddc0656f6d02b1d90f976b2.tar.bz2
ice-3ac86ca67b43924dfddc0656f6d02b1d90f976b2.tar.xz
ice-3ac86ca67b43924dfddc0656f6d02b1d90f976b2.zip
fix for bug 218: Hang if oneways are not flushed
Diffstat (limited to 'java/src')
-rw-r--r--java/src/Ice/_ObjectDelM.java1
-rw-r--r--java/src/IceInternal/Outgoing.java10
-rw-r--r--java/src/IceInternal/ProxyFactory.java26
3 files changed, 36 insertions, 1 deletions
diff --git a/java/src/Ice/_ObjectDelM.java b/java/src/Ice/_ObjectDelM.java
index 85c4c644d4a..26c44951351 100644
--- a/java/src/Ice/_ObjectDelM.java
+++ b/java/src/Ice/_ObjectDelM.java
@@ -202,6 +202,7 @@ public class _ObjectDelM implements _ObjectDel
protected IceInternal.Outgoing
getOutgoing(String operation, OperationMode mode, java.util.Map context)
+ throws IceInternal.NonRepeatable
{
IceInternal.Outgoing out;
diff --git a/java/src/IceInternal/Outgoing.java b/java/src/IceInternal/Outgoing.java
index 6d31ef9a69f..9859932d4a4 100644
--- a/java/src/IceInternal/Outgoing.java
+++ b/java/src/IceInternal/Outgoing.java
@@ -14,6 +14,7 @@ public final class Outgoing
public
Outgoing(Ice.ConnectionI connection, Reference ref, String operation, Ice.OperationMode mode,
java.util.Map context, boolean compress)
+ throws NonRepeatable
{
_connection = connection;
_reference = ref;
@@ -22,7 +23,14 @@ public final class Outgoing
_os = new BasicStream(ref.getInstance());
_compress = compress;
- writeHeader(operation, mode, context);
+ try
+ {
+ writeHeader(operation, mode, context);
+ }
+ catch(Ice.LocalException ex)
+ {
+ abort(ex);
+ }
}
//
diff --git a/java/src/IceInternal/ProxyFactory.java b/java/src/IceInternal/ProxyFactory.java
index 158a12d1247..c3a8132395a 100644
--- a/java/src/IceInternal/ProxyFactory.java
+++ b/java/src/IceInternal/ProxyFactory.java
@@ -105,6 +105,32 @@ public final class ProxyFactory
throw ex;
}
+ //
+ // There is no point in retrying an operation that resulted in a
+ // MarshalException. This must have been raised locally (because if
+ // it happened in a server it would result in an UnknownLocalException
+ // instead), which means there was a problem in this process that will
+ // not change if we try again.
+ //
+ // The most likely cause for a MarshalException is exceeding the
+ // maximum message size, which is represented by the the subclass
+ // MemoryLimitException. For example, a client can attempt to send a
+ // message that exceeds the maximum memory size, or accumulate enough
+ // batch requests without flushing that the maximum size is reached.
+ //
+ // This latter case is especially problematic, because if we were to
+ // retry a batch request after a MarshalException, we would in fact
+ // silently discard the accumulated requests and allow new batch
+ // requests to accumulate. If the subsequent batched requests do not
+ // exceed the maximum message size, it appears to the client that all
+ // of the batched requests were accepted, when in reality only the
+ // last few are actually sent.
+ //
+ if(ex instanceof Ice.MarshalException)
+ {
+ throw ex;
+ }
+
++cnt;
TraceLevels traceLevels = _instance.traceLevels();