Re: Third server not discovered by second server with LateralTCP

Manuel Cruz <[email protected]> Thu, 9 Jul 2009 00:58:30 -0700 (PDT)
Newsgroups gmane.comp.jakarta.turbine.jcs.devel
Message-ID <[email protected]>
Hello Dieter.

  We look your post in nabble's forum about "Thirds erver not discovered by
second server with LateralTCP". We have the same problem but the solution
you gave (synchronized ( instances ) in method getInstances() ) not work to
us  =20

  Can you help us ?    We paste cache.ccf if you can see it.

# DEFAULT CACHE REGION

jcs.default=3DLTCP
jcs.default.cacheattributes=3Dorg.apache.jcs.engine.CompositeCacheAttribute=
s
jcs.default.cacheattributes.MaxObjects=3D1000
jcs.default.cacheattributes.MemoryCacheName=3Dorg.apache.jcs.engine.memory.=
lru.LRUMemoryCache
jcs.default.elementattributes.IsEternal=3Dtrue
#jcs.default.elementattributes.MaxLifeSeconds=3D21600
jcs.default.cacheattributes.UseMemoryShrinker=3Dfalse
jcs.default.cacheattributes.ShrinkerIntervalSeconds=3D60
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3D360000
jcs.default.elementattributes.IsSpool=3Dfalse
jcs.default.elementattributes.IsRemote=3Dfalse
jcs.default.elementattributes.IsLateral=3Dtrue


# PRE-DEFINED CACHE REGIONS

jcs.region.infocorCacheLateral=3DLTCP
jcs.region.infocorCacheLateral.cacheattributes=3Dorg.apache.jcs.engine.Comp=
ositeCacheAttributes
jcs.region.infocorCacheLateral.cacheattributes.MaxObjects=3D1000
jcs.region.infocorCacheLateral.cacheattributes.MemoryCacheName=3Dorg.apache=
.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.infocorCacheLateral.elementattributes.IsEternal=3Dtrue
#jcs.region.infocorCacheLateral.elementattributes.MaxLifeSeconds=3D21600
jcs.region.infocorCacheLateral.cacheattributes.UseMemoryShrinker=3Dfalse
jcs.region.infocorCacheLateral.cacheattributes.ShrinkerIntervalSeconds=3D60
jcs.region.infocorCacheLateral.cacheattributes.MaxMemoryIdleTimeSeconds=3D3=
60000
jcs.region.infocorCacheLateral.elementattributes.IsSpool=3Dfalse
jcs.region.infocorCacheLateral.elementattributes.IsRemote=3Dfalse
jcs.region.infocorCacheLateral.elementattributes.IsLateral=3Dtrue

# AVAILABLE AUXILIARY CACHES

jcs.auxiliary.LTCP=3Dorg.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCP=
CacheFactory
jcs.auxiliary.LTCP.attributes=3Dorg.apache.jcs.auxiliary.lateral.socket.tcp=
.TCPLateralCacheAttributes
jcs.auxiliary.LTCP.attributes.TransmissionTypeName=3DTCP
jcs.auxiliary.LTCP.attributes.TcpServers=3D192.168.1.176:41000,192.168.196:=
41000
jcs.auxiliary.LTCP.attributes.TcpListenerPort=3D41100
jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=3Dfalse
jcs.auxiliary.LTCP.attributes.Receive=3Dtrue
jcs.auxiliary.LTCP.attributes.AllowGet=3Dtrue
jcs.auxiliary.LTCP.attributes.IssueRemoveOnPut=3Dtrue
jcs.auxiliary.LTCP.attributes.FilterRemoveByHashCode=3Dfalse
jcs.auxiliary.LTCP.attributes.PutOnlyMode=3Dfalse


   Regards and thank you =20









Dieter Laufkoetter wrote:
>=20
> Hello,
>=20
> we use an net with 3 servers and use the LateralTCP protocol.
> We don=C2=B4t use musticast (jcs.auxiliary.LTCP.attributes.UdpDiscoveryEn=
abled
> =3D false).
> Each server is configured the other two servers with
> jcs.auxiliary.LTCP.attributes.TcpServers.
>=20
> At first we start server 1.
> Server 1 tries to connect to server 2 and 3.
>=20
> Then we start server 2.
> Server 2 connects to server 1 but does not try to connect to server 3.
> Server 1 connects to server 2
>=20
> Then we start server 3.
> Server 3 connects to server 1 and 2.
> Server 1 connects to server 3.
>=20
> The error:
> Server 2 never tries to connect to server 3 and so the puts of server 2
> never reach server 3.
>=20
> This error occurs with 3 servers on 3 nodes and also with 3 servers on th=
e
> same node.
>=20
>=20
> we found a solution for the problem:
> In the class
> org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager the Ma=
p
> "instances" is synchronised at getInstance() but not at getInstances(). S=
o
> an inconsistent value of instances may be got by call of getInstances().
> The following change of getInstances() fixes the problem:
>=20
>     public Map getInstances()
>     {
>         synchronized ( instances ) {
>             return instances;
>         }
>     }
>=20
> We use new and fast machines, maybe that older and slower machines does
> not produce this synchronisation error.
>=20
> best regards,
>=20
> Dieter
>=20
>=20
>=20
:-((:-((
--=20
View this message in context: http://www.nabble.com/Third-server-not-discov=
ered-by-second-server-with-LateralTCP-tp13855881p24405813.html
Sent from the JCS - Dev mailing list archive at Nabble.com.