Commit Graph
729 Commits
Author SHA1 Message Date
nlevitt f20b3eee30 Fix HER-1935 Many calls to File.mkdirs() and other file/dir methods don't check the return value. Also fix bug where pointless empty directories were created in scratch dir.
* BasicProfileTest.java, SelfTestBase.java, CrawlControllerTest.java, PrecedenceLoader.java, MigrateH1to3Tool.java, CrawlerLoggerModule.java, StatisticsTracker.java, CheckpointUtils.java, BdbUriUniqFilter.java, ARCWriterProcessorTest.java, WARCWriterProcessorTest.java, PersistProcessor.java, WriterPoolProcessor.java, PrefixFinderTest.java, StoredQueueTest.java, FileUtilsTest.java, ObjectIdentityBdbManualCacheTest.java, ObjectIdentityBdbCacheTest.java, ObjectPlusFilesOutputStream.java, TestUtils.java, TmpDirTestCase.java, Engine.java
    Replace calls to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir). In these cases the calls were either already in a spot where the possible IOException would be handled appropriately, or the line was trivially moved into such a block.
* ActionDirectory.java, Engine.java
    replace calls to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir), and throw IllegalStateException on failure
* BdbModule.java
    setup() - replace call to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir) and add "throws IOException" - conveniently the place where this method is called was already in a try block that catches IOException
* Checkpoint.java
    generateFrom() - replace call to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir) and add "throws IOException"
* CheckpointService.java
    move call to Checkpoint.generateFrom() inside existing try block since it now can throw IOException
* Recorder.java
    ensure(File) - replace call to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir), and throw IllegalStateException on failure
    new Recorder(File,String,int,int) - call ensure() on the correct object, the containing directory; and remove redundant call to ensure()
2011-09-12 20:12:10 +00:00
nlevitt f7cc187b09 * ANVLRecord.java
remove accidentally committed test code
2011-09-12 18:22:55 +00:00
nlevitt d2306fced6 Fix for HER-1934 ANVLRecord: clone() method does not call super.clone()
* ANVLRecord.java
    clone() - return (ANVLRecord) super.clone() - this does the right thing
2011-09-12 18:21:21 +00:00
nlevitt 0a28717500 Fix for HER-1922 ThreadLocalHttpConnectionManager: possible memory leak due to non-static inner class.
* ThreadLocalHttpConnectionManager.java
    make nested class ConnectionInfo static so it doesn't reference instance of containing class
2011-09-12 17:53:25 +00:00
nlevitt 40ff3affa3 * ObjectIdentityMemCache.java
fix mistake in r7240 - 'val.setIdentityCache()' was no longer being called the first time through, when the object comes from the 'supplier' (thanks Gordon)
2011-09-12 17:09:29 +00:00
nlevitt 221e63dbd0 Fix for HER-1921 BucketQueueAssignmentPolicy: absolute value of hashCode can be Integer.MIN_VALUE.
* BucketQueueAssignmentPolicy.java
    getClassKey() - cast value to long before taking absolute value
2011-09-12 17:02:54 +00:00
nlevitt 24f4b715ec Various little cleanups including several discovered by Aaron using an automated tool.
* WorkQueueFrontier.java
   (HER-1925) avoid 2 possible null pointer dereferences
* CrawlController.java
    getState() - change declared return type from Object to State
* CrawlerLoggerModule.java
    (HER-1932) remove unused, unset field "reports"
* BdbCookieStorage.java
    elide pointless extra variable
* FetchHTTP.java, DownloadURLConnection.java, ProcessUtils.java
   (HER-1933) use Arrays.toString() for logged arrays
* CrawlServer.java
    - remove unused field robotstxtChecksum
    - updateRobots() - avoid reinventing existing utility class InstanceofPredicate
* ExternalGeoLookupInterface.java
    (HER-1938) extend Serializable, since ExternalGeoLocationDecideRule is declared Serializable and has a ExternalGeoLookupInterface field
* DecideRuleSequence.java
    (HER-1937) make field fileLogger transient
* PersistLogProcessor.java
    (HER-1924) remove field recoveryCheckpoint shadowing same field in superclass Processor
* ExtractorUniversal.java
    (HER-1920) use return value of potentialTLD.toLowerCase() as it appears was intended
* ARCWriterProcessor.java
    (HER-1928) avoid possible null pointer dereference
* S3URLConnection.java
    (HER-1933) set S3ServiceException as cause of rethrown IOException, and do not put stacktrace array in message
* ObjectIdentityMemCache.java
    (HER-1929) avoid possible null pointer dereference
* .classpath
    more source jar references, other cleanup
2011-09-12 02:12:44 +00:00
nlevitt e38f0a73ba * profile-crawler-beans.cxml
<bean id="fetchHttp" class="org.archive.modules.fetcher.FetchHTTP">
    +  <!-- <property name="useHTTP11" value="false" /> -->
2011-09-11 17:02:32 +00:00
nlevitt d3a6dc1f58 Fix for HER-1946 Mid-Crawl Adjustment of frontier.queueTotalBudget does not propagate to retired queues.
* WorkQueueFrontier.java
    findEligibleURI() - propagate queueTotalBudget (also sessionBudget) to ensure the settings are current right before checking if queue is over budget
2011-09-09 23:23:15 +00:00
nlevitt 794c41ebd3 Patch from Kenji to fix "weird 'NoSuchElement' exception retrieving XML response from H3 web interface. It appeared to be concurrency related.... Probably Histotable was accessed concurrently from my JMX interface and web interface and it left Histotable in an inconsistent state. Much less likely without JMX monitoring, but it could also happen with H3 without JMX" (Kenji)
* Histotable.java
    make tally(K,long) synchronized
2011-09-01 21:04:56 +00:00
nlevitt e6de9cd96b * Sheet.java
prime() - fix exception triggered in process of handling earlier real exception, which was masking the real exception - see http://tech.groups.yahoo.com/group/archive-crawler/message/7303
2011-08-30 22:41:37 +00:00
nlevitt cdb6fb3a9a * PersistProcessor.java
copyPersistEnv() - improve logging on history entries by marshalling them as json
2011-08-30 22:04:17 +00:00
nlevitt c70f7ccbc0 * profile-crawler-beans.cxml
remove reference to defunct frontier setting "holdQueues", pointed out by Kristinn Sigurðsson
2011-08-08 23:42:47 +00:00
nlevitt 28aa2ffede * **/pom.xml
improve formatting (no substantive changes at all -- try "svn diff -x -ub -c7232")
2011-08-05 17:46:57 +00:00
nlevitt 178fdd92b6 * **/pom.xml
remove references to unused, defunct agilejava maven repository (had been used for xdoc stuff)
2011-08-05 17:37:16 +00:00
nlevitt ada8cbd198 Fix bug reported by Travis where in certain corner cases where urls are processed in a particular order, a seed can be incorrectly tagged with S_ROBOTS_PREREQUISITE_FAILURE
* DispositionProcessor.java
    innerProcess() - do not update server's robots info if robots fetch has been deferred
2011-08-04 01:32:09 +00:00
nlevitt 706869e586 Fix handling of server error on robots.txt - change to what appears to be the intended behavior
* DispositionProcessor.java
    innerProcess() - call server.updateRobots(curi) after special ignore-robots short-circuiting of retry cycle rather than before, so that updateRobots() deemed-not-found handling applies
* FetchHTTP.java
    call curi.setHttpMethod() right after creating the HttpMethod, instead of when processing the response; this is needed so that updateRobots() check of fetchType works properly (before this change, fetchType was "UNKNOWN" on server error)
* PreconditionEnforcer.java, CrawlServer.java
    fix typos
2011-08-02 23:28:20 +00:00
nlevitt 3cfc315de9 Fix bug reported by Travis where each url in action directory ".include" file is reported as "not canonicalized" in heritrix_out, and some end up crawled in spite of being considered included
* WorkQueueFrontier.java
    considerIncluded(CrawlURI) - call FrontierPreparer.prepare(CrawlURI) so that CrawlURI is canonicalized etc before being considered included (similar to what schedule() does)
* CrawlURI.java
    getCanonicalString(), getPolitenessDelay() - use logger instead of System.err
2011-08-02 01:07:11 +00:00
nlevitt dcbc259776 Fix HER-1917 failure to use good http authentication type if server supports any that heritrix doesn't - problem reported and fix suggested by Adam Wilmer
* HttpAuthenticationCredential.java
    populate() 
        +  http.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY,
        +          Arrays.asList(AuthPolicy.DIGEST, AuthPolicy.BASIC));
2011-07-30 01:30:44 +00:00
nlevitt 26584d44d7 * ExtractorHTMLTest.java
testScriptTagWritingScriptType() - As of r7225, ExtractorJS finds a new url - avoid using a strategically placed space. (The fact that UriUtils.isLikelyUri() returns true for the string ");document.write(unescape(" is kind of crazy, but a separate issue)
2011-07-27 20:04:54 +00:00
nlevitt bda2fbebe4 Fix HER-1873 strings with spaces can confuse ExtractorJS
* ExtractorJS.java
    considerStrings() - backtrack to just ahead of previous closing quote to reconsider it as a possible opening quote
* ExtractorJSTest.java
    minimal test case
2011-07-27 18:56:37 +00:00
nlevitt b2307e7cf1 Fix HER-1914 cookie loading and saving does not work properly
* AbstractCookieStorage.java
    make cookiesLoadFile a ConfigFile and use obtainReader() so that the file is snapshotted into launch dir
    saveCookies() - include expiration date, so file format match the format it claims to use, and what loadCookies() expects 
    loadCookies() - handle expiration date field, and actually put each cookie in the cookie map
    refactor loadCookies() for use with Reader from ConfigFile.obtainReader()
    fix up javadocs some
2011-07-26 19:30:16 +00:00
nlevitt 62e1c835dd Fix HER-1913 cookies not being sent
* CookieSpecBase.java
    match(String, int, String, boolean, SortedMap) - use InternetDomainName.name() instead of .toString(), since the latter doesn't return the plain old domain name
* Cookie.java
    javadoc typo
2011-07-26 19:07:26 +00:00
nlevitt cb7a454d0c Post 3.1.0-RC1
* **/pom.xml
   switch version back to "3.1.0-SNAPSHOT"
2011-07-26 03:42:02 +00:00
nlevitt 347a25e417 Prep for 3.1.0-RC1 release
* pom.xml, */pom.xml
    bump version number to 3.1.0-RC1
2011-07-26 02:57:48 +00:00
nlevitt 3a4419967d Remove PathFixupListener, which was only used for SurtPrefixedDecideRule initialization, now done differently as of r7218.
* ConfigPathConfigurer.java
    remove calls to PathFixupListener
* PathFixupListener.java
    removed
2011-07-25 23:10:02 +00:00
nlevitt a103c5f05c * SurtPrefixedDecideRule.java
fix timing reading surts source to make sure launch dir is in place for snapshot
2011-07-25 22:52:15 +00:00
nlevitt 0c8840db56 * .classpath
reference more source jars retrieved with "mvn dependency:sources"
2011-07-25 21:53:50 +00:00
nlevitt efff6feed6 * CrawlJob.java
avoid NPE on build-then-terminate without a launch
2011-07-25 19:16:31 +00:00
nlevitt e2f29992d4 Put hard limit of 5 on seed redirects being treated as new seeds, to avoid
endless recrawling of the same url(s) in case of a redirect loop.  
* CandidatesProcessor.java
2011-07-23 02:20:35 +00:00
gojomo 269a763860 [HER-1912] Kryo-deserialization of Robotstxt can consume excess memory by creating multiple copies of RobotsDirective
* CrawlServer, Robotstxt
    move autoregister details to Robotstxt, RobotsDirectives
* RobotsDirectives
    use ReferenceFieldSerializer so that repeated instances of RobotsDirectives in same context are replaced with backrefs
* RobotstxtTest
    (from Kenji) unit test for instance multiplication
2011-07-22 06:46:39 +00:00
gojomo a490737b59 * StatisticsTracker
add 'trackSources' to make hosts-by-source-tag report optional in large crawls, where it is very expensive (and an OOME risk until other changes are also made)
2011-07-20 23:36:19 +00:00
gojomo a69126ad21 Reduce redundant Pattern instance caching
* TextUtils
    maintain global Pattern soft-cache by regex string key
2011-07-20 23:04:26 +00:00
nlevitt b3e35499ca HER-1812 Spring-ify how reports are handled - based partly on patch from Kristinn Sigurðsson
* Report.java
    make StatisticsTracker stats an argument to write() instead of a field; new properties shouldReportAtEndOfCrawl and shouldReportDuringCrawl, both default true, but configurable if desired, replacing the LIVE_REPORTS/END_REPORTS stuff in StatisticsTracker
* StatisticsTracker.java
    new property "reports", a List<Report>, which defaults (with lazy initialization) to the same reports we've always had, replacing hard-coded lists of reports classes and related code
* profile-crawler-beans.cxml
    default reports list, commented out
* SeedsReport.java FrontierSummaryReport.java MimetypesReport.java SourceTagsReport.java FrontierNonemptyReport.java CrawlSummaryReport.java ResponseCodeReport.java HostsReport.java ProcessorsReport.java ToeThreadsReport.java
    update write(PrintWriter, StatisticsTracker) arguments
* JobResource.java
    replace use of StatisticsTracker.LIVE_REPORTS
2011-07-20 17:05:12 +00:00
nlevitt e9d53ec487 HER-1791 - a different implementation
* IdenticalDigestDecideRule.java
    fix javadoc typo
* CoreAttributeConstants.java
    "history-good-to-store" is history
* RecrawlAttributeConstants.java
    new "write-tag" constant
* PersistProcessor.java
    remove defunct "history-good-to-store" logic; nadd new option onlyStoreIfWriteTagPresent, and update shouldStore() to respect that option
* WriterPoolProcessor.java
    remove defunct "history-good-to-store" logic; new method copyForwardWriteTagIfDupe(); override innerRejectProcess() to call copyForwardWriteTagIfDupe()
* ARCWriterProcessor.java, WARCWriterProcessor.java
    remove defunct "history-good-to-store" logic; add writeTag to history on write; call copyForwardWriteTagIfDupe() on skipIdenticalDigest
2011-07-18 20:22:48 +00:00
gojomo 421164aaab * ConfigPathConfigurer
log as WARNING when snapshot not possible because launch directory not yet available
2011-07-16 17:49:11 +00:00
nlevitt 0676ded3f2 * CrawlJob.java
fix logging of job events
2011-07-16 00:48:14 +00:00
nlevitt f13b393dab * PersistLogProcessor.java
put default persist log path in launch directory
2011-07-16 00:44:13 +00:00
gojomo e819d197fe [HER-915] (contrib) add http proxy authentication
contributed by Adam Wilmer
* FetchHTTP.java
    properties, setup for http proxy user/password
* profile-crawler-beans.cxml
    commented-out example settings for proxy auth properties
2011-07-15 21:57:20 +00:00
gojomo 4221aee537 fix selftests
* selftest-crawler-beans.cxml
    write logs, arcs to old constant locations, for ease of post-test verification
2011-07-15 21:34:59 +00:00
nlevitt b90aa89e4b More on HER-1901 - fix build by refactoring launch dir initialization into PathSharingContext; refactor config path interpolation mostly into ConfigPathConfigurer; various tweaks
* ActionDirectory.java, CrawlerLoggerModule.java, StatisticsTracker.java, SurtPrefixedDecideRule.java, WriterPoolProcessor.java, profile-crawler-beans.cxml
    use camelcase ${launchId} 
* CheckpointService.java, JobResource.java
    rename getAvailableCheckpointDirectories() to findAvailableCheckpointDirectories() so that it's not treated as a bean property
* WriterPoolProcessor.java, WriterPoolSettingsData.java, WriterPoolMember.java
    rename getOutputDirs() to calcOutputDirs() so that it's not treated as a bean property
* ConfigPath.java
    let ConfigPathConfigurer to do interpolation of ${launchId}
* ConfigFile.java
    let ConfigPathConfigurer do the snapshotting of config file
* CrawlJob.java, PathSharingContext.java
    remove launchDir initialization out of CrawlJob into PathSharingContext
* ConfigPathConfigurer.java
    - remove special handling of WriterPoolProcessor store paths; instead, look in beans for ConfigPaths within Iterables
    - have each ConfigPath hold reference to this ConfigPathConfigurer to use for interpolating ${launchId} and snapshotting config files
2011-07-15 19:39:32 +00:00
gojomo 1bfbec8772 fix build; move Preformatter to package (commons) where first referenced 2011-07-15 19:02:14 +00:00
gojomo 2e10d07da2 [HER-741] Make extractors interrogate for charset
* ExtractorHTML
    fix reflexive probe to look as many characters in (1000) as initially
2011-07-14 06:53:56 +00:00
gojomo be12d1e8f3 calmer logging (fewer alerts in job.log/alerts.log/heritrix_out.log)
* Recorder
    object to unsupported content-encodings when first set
* FetchHTTP
    note as annotation unsupported content-encodings
* Link
    not as annotation when base URI is used for absent via
* ExtractorHTML
    downgrade char-sequence reading problem (often a chunking problem) to WARNING from SEVERE
2011-07-14 06:35:07 +00:00
gojomo 5e2e458469 * StoredQueue
(size) more robust against concurrent emptying
2011-07-14 06:24:14 +00:00
nlevitt 9eb0c137e8 HER-1901 twiddles
* CrawlJob.java
    decided to go with plain timestamp17 as launch id, no "launch-" prefix
* ConfigPathConfigurer.java
    refactored special remembering of WriterPoolProcessor storePaths out of fixupPaths()
2011-07-14 02:03:01 +00:00
gojomo 6a3072ef46 more rapidly release refs for finished CrawlURIs
* UriProcessingFormatter, Preformatter, GenerationFileHandler
    improve preformat-outside-synchronized optimization so that the LogRecord/CrawlURI doesn't linger until next displaces it
* CrawlURI
    (processingCleanup) null more of last-processing-run collected values
2011-07-14 01:14:04 +00:00
nlevitt c84e87c648 More HER-1901
* CrawlJob.java 
    job log in launch dir covering just that launch
2011-07-13 20:47:08 +00:00
nlevitt 4d966ae70b More on HER-1901 - support ${launch-id} interpolation on W/ARCWriterProcessor storePaths
* WriterPoolProcessor.java, ARCWriterProcessor.java, WARCWriterProcessor.java
    change type of storePaths to List<ConfigPath> and handle appropriately
* ConfigPathConfigurer.java
    fixupPaths() - old code did not touch WriterPoolProcessor storePaths, since they're deeply nested inside the bean, but they need to be remembered for later interpolation of ${launch-id}, so add special handling
2011-07-13 20:18:51 +00:00
nlevitt d5b299d1ef * CrawlJob.java
initLaunchId() - didn't mean for this method to be public
2011-07-13 20:13:13 +00:00