aogburn commented on code in PR #882:
URL: https://github.com/apache/tomcat/pull/882#discussion_r2282702181


##########
java/org/apache/catalina/session/FileStore.java:
##########
@@ -217,16 +233,21 @@ public Session load(String id) throws 
ClassNotFoundException, IOException {
     @Override
     public void remove(String id) throws IOException {
         File file = file(id);
-        if (file == null) {
+        if (file == null || !file.exists()) {
             return;
         }
         if (manager.getContext().getLogger().isTraceEnabled()) {
             manager.getContext().getLogger()
                     .trace(sm.getString(getStoreName() + ".removing", id, 
file.getAbsolutePath()));
         }
 
-        if (file.exists() && !file.delete()) {
-            throw new 
IOException(sm.getString("fileStore.deleteSessionFailed", file));
+        try{
+            acquireIdWriteLock(id);
+            if (file.exists() && !file.delete()) {

Review Comment:
   We'll actually modify (remove) the session file here so we should acquire 
the lock to protect from modifying the file during any potential load that may 
be reading it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to