Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-07-17 05:03:31 -0400
committerEike Stepper2015-07-17 05:03:31 -0400
commit504b4e687c057d5b29bc7ff461dea2e840602185 (patch)
treedcba411e7495f982f5e1db45164d2c2aab615040 /plugins/org.eclipse.emf.cdo.server.net4j
parent0d7c85286fc360c149c5f3f2e93c6193a4892a3f (diff)
downloadcdo-504b4e687c057d5b29bc7ff461dea2e840602185.tar.gz
cdo-504b4e687c057d5b29bc7ff461dea2e840602185.tar.xz
cdo-504b4e687c057d5b29bc7ff461dea2e840602185.zip
[472924] Problems with explicit locking and high-frequency session open/close
https://bugs.eclipse.org/bugs/show_bug.cgi?id=472924
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.net4j')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenedSessionNotification.java46
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java4
6 files changed, 68 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF
index 9a286e1b00..048d55afcd 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.server.net4j;singleton:=true
-Bundle-Version: 4.1.200.qualifier
+Bundle-Version: 4.1.300.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -12,6 +12,6 @@ Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.emf.cdo.server;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.server.internal.net4j.bundle;version="4.1.200";x-internal:=true,
- org.eclipse.emf.cdo.server.internal.net4j.protocol;version="4.1.200";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.server.net4j;version="4.1.200"
+Export-Package: org.eclipse.emf.cdo.server.internal.net4j.bundle;version="4.1.300";x-internal:=true,
+ org.eclipse.emf.cdo.server.internal.net4j.protocol;version="4.1.300";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.server.net4j;version="4.1.300"
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
index 1f3f8cba50..88bbb15734 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
@@ -34,6 +34,7 @@ import org.eclipse.net4j.signal.security.AuthenticationRequest;
import org.eclipse.net4j.util.io.StringCompressor;
import org.eclipse.net4j.util.io.StringIO;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.security.CredentialsUpdateOperation;
import org.eclipse.net4j.util.security.DiffieHellman.Client.Response;
import org.eclipse.net4j.util.security.DiffieHellman.Server.Challenge;
@@ -45,6 +46,8 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession>implements
{
public static final long DEFAULT_NEGOTIATION_TIMEOUT = 15 * 1000;
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, CDOServerProtocol.class);
+
private long negotiationTimeout = DEFAULT_NEGOTIATION_TIMEOUT;
private IRepositoryProvider repositoryProvider;
@@ -220,7 +223,10 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession>implements
protected void handleInactiveSession()
{
- OM.LOG.warn("Session channel is inactive: " + this); //$NON-NLS-1$
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Session channel is inactive: " + this); //$NON-NLS-1$
+ }
}
@Override
@@ -378,6 +384,9 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession>implements
case SIGNAL_LOAD_OBJECT_LIFETIME:
return new LoadObjectLifetimeIndication(this);
+ case SIGNAL_OPENED_SESSION:
+ return new OpenedSessionNotification(this);
+
default:
return super.createSignalReactor(signalID);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
index 4681bdfa03..23822b846a 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
@@ -46,6 +46,11 @@ public class LockObjectsIndication extends CDOServerWriteIndication
super(protocol, signalID);
}
+ protected IView getView(int viewID)
+ {
+ return getSession().getView(viewID);
+ }
+
@Override
protected void indicating(CDODataInput in) throws IOException
{
@@ -66,11 +71,6 @@ public class LockObjectsIndication extends CDOServerWriteIndication
result = repository.lock((InternalView)view, lockType, revisionKeys, recursive, timeout);
}
- protected IView getView(int viewID)
- {
- return getSession().getView(viewID);
- }
-
@Override
protected void responding(CDODataOutput out) throws IOException
{
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java
index 4078fed6a3..7c02e8cefd 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java
@@ -192,7 +192,7 @@ public class OpenSessionIndication extends CDOServerIndicationWithMonitoring
}
out.writeLong(repository.getCreationTime());
- out.writeLong(repository.getLastCommitTimeStamp());
+ out.writeLong(session.getFirstUpdateTime());
out.writeCDOID(repository.getRootResourceID());
out.writeBoolean(repository.isAuthenticating());
out.writeBoolean(repository.isSupportingAudits());
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenedSessionNotification.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenedSessionNotification.java
new file mode 100644
index 0000000000..9750edb2ce
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenedSessionNotification.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2009-2013, 2015 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Christian W. Damus (CEA LIST) - bug 418454
+ */
+package org.eclipse.emf.cdo.server.internal.net4j.protocol;
+
+import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.spi.server.InternalSession;
+
+import org.eclipse.net4j.signal.Indication;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
+
+/**
+ * @author Eike Stepper
+ */
+public class OpenedSessionNotification extends Indication
+{
+ public OpenedSessionNotification(CDOServerProtocol protocol)
+ {
+ super(protocol, CDOProtocolConstants.SIGNAL_OPENED_SESSION);
+ }
+
+ @Override
+ protected void indicating(ExtendedDataInputStream in) throws Exception
+ {
+ CDOServerProtocol protocol = (CDOServerProtocol)getProtocol();
+ InternalSession session = protocol.getSession();
+
+ if (in.readBoolean())
+ {
+ session.setOpenOnClientSide();
+ }
+ else
+ {
+ // Can't possibly happen.
+ session.close();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java
index 19f6bda99a..6a124f709a 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java
@@ -42,13 +42,13 @@ public class RepositoryTimeIndication extends CDOServerIndication
@Override
protected void indicating(CDODataInput in) throws IOException
{
- indicated = System.currentTimeMillis();
+ indicated = getRepository().getTimeStamp();
}
@Override
protected void responding(CDODataOutput out) throws IOException
{
- long responded = System.currentTimeMillis();
+ long responded = getRepository().getTimeStamp();
if (TRACER.isEnabled())
{
TRACER.format("Writing indicated: {0}", CDOCommonUtil.formatTimeStamp(indicated)); //$NON-NLS-1$

Back to the top