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

Memcached Session Manager failing in multi-threaded environment #460

Open
Chiranjib-848 opened this issue Nov 14, 2023 · 0 comments
Open

Comments

@Chiranjib-848
Copy link

Chiranjib-848 commented Nov 14, 2023

I am using memcached session manager in a muilti-threaded spring web-application everything is working fine but downloads and printing sometime gives error, we are setting session values through session.setAttribute() through the application where required.

  • Download and print(opening a pdf file in new tab) are achieved through multi-threading for better performance.
  • Mostly the first download request doesn't complete.
    
  • But subsequently afterwards on same selection of records it works for all file types (xls,csv,txt)
    
  • For print mostly as i have observed ocassionally after three times it works.
    
  • Print page opens in a new tab through form submit and then through ajax second method is hit all parameters are stored in db along with job-id is created and executed simultaneously, here data is extracted from back end.
    
  • the second method returns the job-id which is checked continuously in js ajax call for status to be completed.
    
  • then final ajax call prints the file in new opened tab.
    
  • then session is updated at required times through the new threads created.
    

This is my memcached-configuration in context.xml

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
             memcachedNodes="memcahed-cluster-node:11211"
             memcachedProtocol="text"
             sticky="false"
             sessionBackupAsync="false"
             lockingMode="all"
    />

The jar file list in application lib directory are:-

kryo-serializers-0.8.jar minlog-1.2.jar reflectasm-0.9.jar AmazonElastiCacheClusterClient-no-version.jar asm-3.2.jar javolution-5.4.3.1.jar kryo-1.03.jar

The jar files in tomcat's lib are:-

spymemcached-2.11.7.jar memcached-session-manager-2.3.2.jar memcached-session-manager-tc8-2.3.2.jar

In beanstalk the session stickiness is disabled and loadbalanced with minimum two instances for testing. And we are using Tomcat 8.5 server Also we are using AWS memcached cluster node.

The above configuration is the only criteria under which the application is functioning except the above written issues. I tried lockingMode "auto" but not able to login. As I checked the logs for the download and print request which is not completing, It is showing the continuous calls to check job status completed or not from networks tab in browser. But the value i checked shows completed and it should then print according to application flow.

Please point out favorable points for resolving this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant