Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [leshan-dev] Persist sessions to restore connections

Hi,

 I just write a new wiki page to explain this : https://github.com/eclipse/leshan/wiki/Server-Failover 

 (This means the page is maybe not so clear and full of spelling mistakes ^^)

 But I hope this would be clearer for you.

Simon

Le 01/10/2018 à 11:00, Arjun Kamath a écrit :
Hi all,

I've been looking for a way to ensure that notifications sent by a client are continued to be received by the LWM2M server after the server restarts/crashes and reboots. 

I first unsuccessfully tried to persist connections, but that seemed unnecessarily complex.

After the recommendation from this issue: https://github.com/eclipse/leshan/issues/554, I tried to persist DTLSSessions using the sessionCache interface. For this I had to implement/adapt serializers for some classes. 

Luckily this works! When a client registers, the DTLSSession is persisted on sessionEstablished event. Then the server observes a resource and notifications are received. The server then stops and restarts. On restart the sessions are read and for each session a connection object is created and the inMemoryConnectionStore is populated.

The notifications thus continue to be received. 

All good, but I'm trying to understand why exactly this works and when would it not work. Since the session was saved when the client registered, there can be a significant time between saving a session and restoring it. 

My first guess is that since we're talking about UDP here, the server simply assumes that some packets were lost and just continues as though nothing happened. But this explanation seems to simple. 

Also, it appears that losing parts of the connection object (basically everything other than the session object) has no bearing whatsoever to the normal functioning of the server. 

Regards,



_______________________________________________
leshan-dev mailing list
leshan-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/leshan-dev

Back to the top