incubator-openmeetings-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "seba.wagner@gmail.com" <seba.wag...@gmail.com>
Subject no need to sync on slave if server is null ?!
Date Wed, 26 Dec 2012 22:18:46 GMT
Hi Maxim,

I found this fix from you:

Server s = clientSessionInfo.getServerId() != null ?
serverDao.get(clientSessionInfo.getServerId()) : null;
            if (s != null) {
                // no need to sync on slave if server is null
                clusterSlaveJob.syncMessageToClientOnSlave(s,
clientSessionInfo.getRcl().getPublicSID() , message);
            }

What should that mean and what enhancements should it bring?

Actually if server == null it means that the client is handled on the same
server.
Basically on a slave ALL sessions have the server == null, because from the
perspective of the slave every session is locally. In fact the slave does
not even know that he is a slave. He handles every connection as if there
is no difference.

So why should the slave NOT sync that message ? That makes no sense to me.

Server == null is a correct implementation and it should not throw any
NullPointerException.
It simply means that the Session is local and not on another server.
Actually only this kind of session could have a s != null:
A session that is synced from the slave to the master. The master would
have this session with a Server != null.

So your comment does not makes sense to me.
Of course slaves do sync messages. On the slave the "server" argument is
_always_ null. But of course the slave should still sync that message.

Sebastian


-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message