directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1798350 - /directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
Date Sun, 11 Jun 2017 08:08:52 GMT
Author: elecharny
Date: Sun Jun 11 08:08:52 2017
New Revision: 1798350

URL: http://svn.apache.org/viewvc?rev=1798350&view=rev
Log:
Added a log to tell when the server ca't create a temporary file (DIRSERVER-2091/DIRSERVER-2007)

Modified:
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java?rev=1798350&r1=1798349&r2=1798350&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
Sun Jun 11 08:08:52 2017
@@ -93,6 +93,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.mina.core.session.IoSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -105,6 +107,9 @@ import org.apache.mina.core.session.IoSe
  */
 public class DefaultCoreSession implements CoreSession
 {
+    /** A logger for this class */
+    private static final Logger LOG = LoggerFactory.getLogger( DefaultCoreSession.class );
+    
     /** The DirectoryService we are connected to */
     private final DirectoryService directoryService;
 
@@ -1329,6 +1334,19 @@ public class DefaultCoreSession implemen
         SortedEntrySerializer keySerializer = new SortedEntrySerializer();
         SortedEntrySerializer.setSchemaManager( schemaManager );
         
+        File file = null;
+        
+        try 
+        {
+            file = File.createTempFile( "replica", ".sorted-data" );    // see DIRSERVER-2007
+        } 
+        catch ( IOException e ) 
+        {
+            // see DIRSERVER-2091
+            LOG.error("Error creating temp file in directory {} for sorting: {}",  System.getProperty(
"java.io.tmpdir" ),  e.getMessage(), e);
+            throw e;
+        }
+        
         File file = File.createTempFile( "replica", ".sorted-data" );// see DIRSERVER-2007
         BaseRecordManager recMan = new BaseRecordManager( file.getAbsolutePath() );
 



Mime
View raw message