Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-09-03 10:39:53 +0000
committerEike Stepper2013-09-03 10:39:53 +0000
commit351f8c20e71c944e9b279ebe0159030616dfe137 (patch)
tree64cd3a783b8c90451bca6ade912517773bbee3f3
parent28459eb02e0ea66f3c5704dfa4004cf4354b4e61 (diff)
downloadcdo-351f8c20e71c944e9b279ebe0159030616dfe137.tar.gz
cdo-351f8c20e71c944e9b279ebe0159030616dfe137.tar.xz
cdo-351f8c20e71c944e9b279ebe0159030616dfe137.zip
[416417] Avoid logging errors that are caused by asynchronous
deactivation https://bugs.eclipse.org/bugs/show_bug.cgi?id=416417
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java15
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/PluginContainer.java6
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ReflectUtil.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java17
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java17
6 files changed, 51 insertions, 16 deletions
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java
index 3959acde2a..7dd70adde6 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientIndication.java
@@ -24,6 +24,7 @@ import org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl;
import org.eclipse.net4j.signal.Indication;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.StringIO;
+import org.eclipse.net4j.util.lifecycle.LifecycleException;
import org.eclipse.net4j.util.lifecycle.LifecycleState;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
@@ -61,7 +62,14 @@ public abstract class CDOClientIndication extends Indication
LifecycleUtil.waitForActive(session, 10000L);
}
- LifecycleUtil.checkActive(session);
+ try
+ {
+ LifecycleUtil.checkActive(session);
+ }
+ catch (LifecycleException ex)
+ {
+ throw new LifecycleException(session + " is inactive in " + getClass().getName(), ex);
+ }
indicating(new CDODataInputImpl(in)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 00a088899d..7d0c16ad58 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -70,6 +70,7 @@ import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.event.Notifier;
import org.eclipse.net4j.util.event.ThrowableEvent;
+import org.eclipse.net4j.util.lifecycle.LifecycleException;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.log.OMLogger;
import org.eclipse.net4j.util.om.monitor.EclipseMonitor;
@@ -905,7 +906,19 @@ public class CDOViewImpl extends AbstractCDOView
if (invalidationRunner == null)
{
invalidationRunner = createInvalidationRunner();
- invalidationRunner.activate();
+
+ try
+ {
+ invalidationRunner.activate();
+ }
+ catch (LifecycleException ex)
+ {
+ // Don't pollute the log if the worker thread is interrupted due to asynchronous view.close()
+ if (!(ex.getCause() instanceof InterruptedException))
+ {
+ throw ex;
+ }
+ }
}
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/PluginContainer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/PluginContainer.java
index bf4bb92172..c0bb001f43 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/PluginContainer.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/PluginContainer.java
@@ -36,6 +36,12 @@ public class PluginContainer extends ManagedContainer implements IPluginContaine
}
@Override
+ public String toString()
+ {
+ return "PluginContainer"; //$NON-NLS-1$
+ }
+
+ @Override
protected IRegistry<IFactoryKey, IFactory> createFactoryRegistry()
{
return new PluginFactoryRegistry(this);
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ReflectUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ReflectUtil.java
index 0e87f4303b..18578feb94 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ReflectUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/ReflectUtil.java
@@ -231,6 +231,8 @@ public final class ReflectUtil
}
/**
+ * Prints the stack trace of the current thread to {@link System#err}.
+ *
* @since 3.4
*/
public static void printStackTrace()
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java
index e61399643d..6df77dd16a 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java
@@ -137,17 +137,20 @@ public abstract class Worker extends Lifecycle
*/
protected void handleError(Exception ex)
{
- try
+ if (isActive())
{
- if (globalErrorHandler != null)
+ try
+ {
+ if (globalErrorHandler != null)
+ {
+ globalErrorHandler.handleError(ex);
+ }
+ }
+ catch (Exception exFromErrorHandler)
{
- globalErrorHandler.handleError(ex);
+ OM.LOG.error(exFromErrorHandler);
}
}
- catch (Exception ex1)
- {
- OM.LOG.error(ex1);
- }
}
protected abstract void work(WorkContext context) throws Exception;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
index 5f8432142e..2e60ff6756 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
@@ -150,17 +150,20 @@ public abstract class Signal implements Runnable
}
catch (Exception ex)
{
- if (getProtocol().isActive())
+ if (LifecycleUtil.isActive(protocol))
{
- OM.LOG.error(ex);
- }
- else
- {
- if (TRACER.isEnabled())
+ Object infraStructure = protocol.getInfraStructure();
+ if (infraStructure == null || LifecycleUtil.isActive(infraStructure))
{
- TRACER.trace("Exception while protocol is inactive", ex); //$NON-NLS-1$
+ OM.LOG.error(ex);
+ return;
}
}
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Exception while protocol is inactive", ex); //$NON-NLS-1$
+ }
}
finally
{

Back to the top