jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1518227 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
Date Wed, 28 Aug 2013 14:52:17 GMT
Author: mduerig
Date: Wed Aug 28 14:52:16 2013
New Revision: 1518227

URL: http://svn.apache.org/r1518227
Log:
OAK-960 Enable session refresh state coordination between multiple session in single thread
Reduce warnings about long living sessions to sessions that do not refresh

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java?rev=1518227&r1=1518226&r2=1518227&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RefreshManager.java
Wed Aug 28 14:52:16 2013
@@ -87,8 +87,12 @@ public class RefreshManager {
         // Don't refresh if this operation is a refresh operation itself or
         // a save operation, which does an implicit refresh
         if (!sessionOperation.isRefresh() && !sessionOperation.isSave()) {
-            if (warnIfIdle && !refreshAtNextAccess && !hasInThreadCommit()
-                    && timeElapsed > MILLISECONDS.convert(1, MINUTES)) {
+            if (refreshAtNextAccess || hasInThreadCommit() || timeElapsed >= refreshInterval)
{
+                // Refresh if forced or if the session has been idle too long
+                refreshAtNextAccess = false;
+                sessionSaveCount = getThreadSaveCount();
+                return true;
+            } else if (warnIfIdle && timeElapsed > MILLISECONDS.convert(1, MINUTES))
{
                 // TODO replace logging with JMX monitoring. See OAK-941
                 // Warn once if this session has been idle too long
                 log.warn("This session has been idle for " + MINUTES.convert(timeElapsed,
MILLISECONDS) +
@@ -96,12 +100,6 @@ public class RefreshManager {
                         " refresh the session.", initStackTrace);
                 warnIfIdle = false;
             }
-            if (refreshAtNextAccess || hasInThreadCommit() || timeElapsed >= refreshInterval)
{
-                // Refresh if forced or if the session has been idle too long
-                refreshAtNextAccess = false;
-                sessionSaveCount = getThreadSaveCount();
-                return true;
-            }
         }
 
         if (sessionOperation.isSave()) {



Mime
View raw message