Skip to content

Commit

Permalink
ATS-23
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Müller authored and Matthias Müller committed Apr 3, 2020
1 parent 65381ba commit 31d15d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/appng/tomcat/session/mongo/MongoStore.java
Expand Up @@ -332,7 +332,7 @@ public StandardSession load(String id) throws ClassNotFoundException, IOExceptio
session.readObjectData(ois);
session.setManager(this.manager);

if (!(sticky || TOMCAT_SESSION_THREAD.equals(threadName))) {
if (!(sticky || threadName.startsWith(TOMCAT_SESSION_THREAD))) {
BasicDBObject setHost = new BasicDBObject("$set", new BasicDBObject(HOST_PROPERTY,
String.format("%s@%s", Thread.currentThread().getName(), hostName)));
this.collection.update(sessionQuery, setHost);
Expand Down Expand Up @@ -362,7 +362,7 @@ private DBObject getMongoSession(String id) {
if (sticky) {
String owningThread = null;
String threadName = Thread.currentThread().getName();
if (!TOMCAT_SESSION_THREAD.equals(threadName)) {
if (!threadName.startsWith(TOMCAT_SESSION_THREAD)) {
while (waited < maxWaitTime && (owningThread = sessionsInUse.get(id)) != null
&& !owningThread.equals(threadName)) {
info("Session %s is still used by thread %s, waiting %sms.", id, owningThread, waitTime);
Expand Down

0 comments on commit 31d15d5

Please sign in to comment.