Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-06-11 06:54:29 -0400
committerEike Stepper2013-06-11 06:54:29 -0400
commit253edab67bb3efacc2794b77c44d0c749d1caeee (patch)
tree140461945a7177f9d55915232aaf7de3777875c0
parent50a804b7fe45dbed1d7b7ead2e33597631c731bb (diff)
downloadcdo-253edab67bb3efacc2794b77c44d0c749d1caeee.tar.gz
cdo-253edab67bb3efacc2794b77c44d0c749d1caeee.tar.xz
cdo-253edab67bb3efacc2794b77c44d0c749d1caeee.zip
[410446] FailOverMonitor might not deactivate properly
https://bugs.eclipse.org/bugs/show_bug.cgi?id=410446
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverMonitor.java13
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java23
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/heartbeat/HeartBeatProtocol.java10
3 files changed, 33 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverMonitor.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverMonitor.java
index bf8cd1e44c..2cc6591c75 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverMonitor.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/net4j/FailoverMonitor.java
@@ -336,8 +336,17 @@ public class FailoverMonitor extends Container<AgentProtocol>
@Override
protected void doDeactivate() throws Exception
{
- failoverMonitor.deregisterAgent(this);
- super.doDeactivate();
+ try
+ {
+ if (failoverMonitor != null)
+ {
+ failoverMonitor.deregisterAgent(this);
+ }
+ }
+ finally
+ {
+ super.doDeactivate();
+ }
}
/**
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
index e76e6da6cb..9a3da8dd5f 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
@@ -290,19 +290,24 @@ public class SignalProtocol<INFRA_STRUCTURE> extends Protocol<INFRA_STRUCTURE> i
@Override
protected void doDeactivate() throws Exception
{
- synchronized (signals)
+ try
{
- signals.clear();
- }
+ synchronized (signals)
+ {
+ signals.clear();
+ }
- IChannel channel = getChannel();
- if (channel != null)
+ IChannel channel = getChannel();
+ if (channel != null)
+ {
+ channel.close();
+ setChannel(null);
+ }
+ }
+ finally
{
- channel.close();
- setChannel(null);
+ super.doDeactivate();
}
-
- super.doDeactivate();
}
@Override
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/heartbeat/HeartBeatProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/heartbeat/HeartBeatProtocol.java
index 70856f9921..e0b79d4e7f 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/heartbeat/HeartBeatProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/heartbeat/HeartBeatProtocol.java
@@ -258,8 +258,14 @@ public class HeartBeatProtocol extends SignalProtocol<Object>
@Override
protected void doDeactivate() throws Exception
{
- cancelHeartBeatTask();
- super.doDeactivate();
+ try
+ {
+ cancelHeartBeatTask();
+ }
+ finally
+ {
+ super.doDeactivate();
+ }
}
/**

Back to the top