Merge branch 'feature/SEARCH_2187_timeouts' into 'fix/SEARCH_2175_CascadeTracker'

Feature/search 2187 timeouts

See merge request search_discovery/insightengine!462
This commit is contained in:
Andrea Gazzarini
2020-04-15 13:43:06 +01:00
4 changed files with 32 additions and 23 deletions
@@ -296,6 +296,8 @@ public class SolrInformationServer implements InformationServer
private String skippingDocsQueryString;
private boolean isSkippingDocsInitialized;
private long maxAllowedTimeForAcquiringDbIdLock;
protected enum FTSStatus {New, Dirty, Clean}
static class DocListCollector implements Collector, LeafCollector
@@ -461,6 +463,8 @@ public class SolrInformationServer implements InformationServer
holeRetention = Integer.parseInt(p.getProperty("alfresco.hole.retention", "3600000"));
minHash = Boolean.parseBoolean(p.getProperty("alfresco.fingerprint", "true"));
maxAllowedTimeForAcquiringDbIdLock = Long.parseLong(p.getProperty("alfresco.tracker.maxNodeLockMs", "120000"));
dataModel = AlfrescoSolrDataModel.getInstance();
contentStreamLimit = Integer.parseInt(p.getProperty("alfresco.contentStreamLimit", "10000000"));
@@ -3182,9 +3186,9 @@ public class SolrInformationServer implements InformationServer
// I don't think we are concerned with this exception.
}
if (System.currentTimeMillis() - startTime > 120000)
if (System.currentTimeMillis() - startTime > maxAllowedTimeForAcquiringDbIdLock)
{
throw new AlfrescoLockException("Unable to acquire lock on nodeId " + id + " after " + 120000 + " msecs.");
throw new AlfrescoLockException("Unable to acquire lock on nodeId " + id + " after " + maxAllowedTimeForAcquiringDbIdLock + " msecs.");
}
}
}
@@ -30,6 +30,9 @@ alfresco.hole.check.after=300000
alfresco.batch.count=5000
alfresco.recordUnindexedNodes=false
# max time (in msecs) a given tracker instance will try to acquire a lock on a given DBID
alfresco.tracker.maxNodeLockMs=120000
# encryption
# none, https
@@ -30,6 +30,9 @@ alfresco.hole.check.after=300000
alfresco.batch.count=5000
alfresco.recordUnindexedNodes=false
# max time (in msecs) a given tracker instance will try to acquire a lock on a given DBID
alfresco.tracker.maxNodeLockMs=120000
# encryption
# none, https
@@ -25,24 +25,9 @@
*/
package org.alfresco.solr.client;
import static java.util.Optional.ofNullable;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.httpclient.AlfrescoHttpClient;
import org.alfresco.httpclient.AuthenticationException;
@@ -84,9 +69,23 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.extensions.surf.util.URLEncoder;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import static java.util.Optional.ofNullable;
// TODO error handling, including dealing with a repository that is not responsive (ConnectException in sendRemoteRequest)
// TODO get text content transform status handling