Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Study possible ways to replicate HTTP sessions (Tomcat based) #8923

Closed
mshaposhnik opened this issue Feb 27, 2018 · 3 comments
Closed

Study possible ways to replicate HTTP sessions (Tomcat based) #8923

mshaposhnik opened this issue Feb 27, 2018 · 3 comments
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it.

Comments

@mshaposhnik
Copy link
Contributor

Description

To enable parallel run of several master instances we need to synchonize state of the HTTP sessions to avoid unstable behavior.

Docs:
[1] https://tomcat.apache.org/tomcat-8.0-doc/cluster-howto.html

@mshaposhnik
Copy link
Contributor Author

I have tried the following conf and everything is worked except the Subject object needs to be refactored.

Changes reqired:

  • web.xml - add <distributable/> tag;
  • server.sml - add cluster section:
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
        channelSendOptions="6">

        <Manager className="org.apache.catalina.ha.session.BackupManager"
          expireSessionsOnShutdown="false"
          notifyListenersOnReplication="true"
          mapSendOptions="6"/>
        <Channel className="org.apache.catalina.tribes.group.GroupChannel">
          <Membership className="org.apache.catalina.tribes.membership.McastService"
            address="228.0.0.4"
            port="45564"
            frequency="500"
            dropTime="3000"/>
          <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
            address="auto"
            port="5000"
            selectorTimeout="100"
            maxThreads="6"/>

          <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
            <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
          </Sender>
          <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
          <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
          <Interceptor className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/>
        </Channel>

        <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
          filter=".*\.gif|.*\.js|.*\.jpeg|.*\.jpg|.*\.png|.*\.htm|.*\.html|.*\.css|.*\.txt"/>
        <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
      </Cluster>

@mshaposhnik
Copy link
Contributor Author

The following error appears when Tomcat tries to send session state:


2018-02-23 14:40:45,865[nio-8080-exec-4]  [ERROR] [.a.c.t.t.AbstractReplicatedMap 477]  - Unable to diff object. Will replicate the entire object instead.
--
  | java.io.NotSerializableException: org.eclipse.che.multiuser.api.permission.server.PermissionCheckerImpl
  | at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
  | at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
  | at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
  | at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
  | at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
  | at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
  | at org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.writeExternal(DeltaRequest.java:401)
  | at org.apache.catalina.ha.session.DeltaRequest.writeExternal(DeltaRequest.java:294)
  | at org.apache.catalina.ha.session.DeltaRequest.serialize(DeltaRequest.java:308)
  | at org.apache.catalina.ha.session.DeltaSession.getDiff(DeltaSession.java:138)
  | at org.apache.catalina.tribes.tipis.AbstractReplicatedMap.replicate(AbstractReplicatedMap.java:472)
  | at org.apache.catalina.ha.session.BackupManager.requestCompleted(BackupManager.java:98)
  | at org.apache.catalina.ha.tcp.ReplicationValve.send(ReplicationValve.java:523)
  | at org.apache.catalina.ha.tcp.ReplicationValve.sendMessage(ReplicationValve.java:511)
  | at org.apache.catalina.ha.tcp.ReplicationValve.sendSessionReplicationMessage(ReplicationValve.java:493)
  | at org.apache.catalina.ha.tcp.ReplicationValve.sendReplicationMessage(ReplicationValve.java:404)
  | at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:333)
  | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
  | at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
  | at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
  | at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
  | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
  | at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
  | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  | at java.lang.Thread.run(Thread.java:748)


@gorkem gorkem mentioned this issue Feb 27, 2018
19 tasks
@skabashnyuk skabashnyuk added status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. kind/task Internal things, technical debt, and to-do tasks to be performed. team/platform labels Mar 5, 2018
@skabashnyuk
Copy link
Contributor

we want to avoid http session replication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it.
Projects
None yet
Development

No branches or pull requests

2 participants