Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDOLock: handling of network outages (Remotely disconnect non-responsive lock / user)
[CDO] CDOLock: handling of network outages [message #1739728] Thu, 04 August 2016 11:13 Go to next message
Robert Schulk is currently offline Robert SchulkFriend
Messages: 118
Registered: July 2015
Senior Member
Hi all,

let's consider the following situation:
* user is connected to a CDORepository
* user acquires a CDOLock on a resources
* the network gets disconnected

In this case, the resource lock is maintained - probably the server waits until the client might reconnect?

I think that this is a great feature, but we run into the following issue:
* user closes the client application so that it will never reconnect to the server
* network reconnects
* user opens another instance of the client application and would like to access the same resource - but it will stay locked
* After some time, the lock seems to be automatically released (I think it was around 15min)

So is it possible to:
1) identify if a lock comes from a non-responsive client?
2) obtain the IP address of a client that is holding a lock?
3) modify the timeout until the session of a non-reachable client will be automatically disconnected?
4) remotely disconnect the user or the lock?
Re: [CDO] CDOLock: handling of network outages [message #1741984 is a reply to message #1739728] Fri, 12 August 2016 10:29 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6579
Registered: July 2009
Senior Member
Am 04.08.2016 um 13:13 schrieb Robert Schulk:
> Hi all,
>
> let's consider the following situation:
> * user is connected to a CDORepository
> * user acquires a CDOLock on a resources
> * the network gets disconnected
>
> In this case, the resource lock is maintained - probably the server waits until the client might reconnect?
>
> I think that this is a great feature,
This is not a feature, but rather a highly OS-dependent side-effect. Let me explain: The lifespan of a CDOLock is
restricted by the lifespan of the locking CDOView (the "lock owner"). The lifespan of the CDOView is restricted by the
underlying CDOSession which, in turn, is restricted by its CDOSessionProtocol. The latter is restricted by its IChannel
and that is restricted by its IConnector, which represents the physical transport connection (likely TCP in your case).
In case of physical network outages it highly depends on the OS and the connection configuration whether (and what)
timeouts apply (likely 15 minutes in your case).

> but we run into the following issue: * user closes the client application so that it will never reconnect to the server
> * network reconnects
> * user opens another instance of the client application and would like to access the same resource - but it will stay
> locked
> * After some time, the lock seems to be automatically released (I think it was around 15min)
Yes, that all seems in line with what I explained above.

To work around the uncertainty of the external timeouts I strongly recommend to route an
org.eclipse.net4j.signal.heartbeat.HeartBeatProtocol through the IConnector that's used by the CDOSession. It would
cause the client-side and the server-side sessions to time out predictably. The subclasses of
org.eclipse.emf.cdo.internal.net4j.RecoveringCDOSessionImpl (e.g., FailoverCDOSessionImpl and
ReconnectingCDOSessionImpl) use the same approach.

>
> So is it possible to:
> 1) identify if a lock comes from a non-responsive client?
You could implement your own JMS-like protocol via CDORemoteSessionMessages, or just rely on smaller timeouts with a
HeartBeatProtocol .

> 2) obtain the IP address of a client that is holding a lock?
You could either use CDORemoteSessionMessages or determine the IConnector's IP address. For the latter approach look at
the CDOLockOwners of the CDOLockState. The CDOLockOwner gives you the session ID, which you can use to obtain the
ISession, the ISessionProtocol, the IChannel, and the IConnector.

> 3) modify the timeout until the session of a non-reachable client will be automatically disconnected?
Yes, with a HeartBeatProtocol.

> 4) remotely disconnect the user or the lock?
You can write server-side code that closes the IView that owns the lock. To deal with physical network outages you need
a HeartBeatProtocol.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:Call for Submissions: Modeling Symposium @ EclipseCon Europe 2016
Next Topic:[CDO] EMF Compare with CDOFileResources
Goto Forum:
  


Current Time: Sun Jun 20 23:28:45 GMT 2021

Powered by FUDForum. Page generated in 0.01496 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top