CrawlURI.data between processing
Without this change (or other measures), we sometimes get nulls in the
ExtractorYoutubeDL log for containing page information. We'll run this
on QA for a while and see if it causes any problems.
nlevitt [1:59 PM]
https://github.com/internetarchive/heritrix3/blob/master/modules/src/main/java/org/archive/modules/CrawlURI.java#L878
drops some stuff from `CrawlURI.data` after processing a uri, even if it needs to be processed again
there is a list of keys that shouldn’t be dropped (`persistentKeys`), but it is final and private
so if you’re writing your own heritrix module and you want to keep some information in CrawlURI.data, it usually works, except when the url is processed more than once (like when it needs a prereq like robots.txt the first time)
in practice it seems that most data is persisted, that is, most commonly used keys are in `persistentKeys`
in a crawl with pretty standard configuration i’m mostly seeing `prerequisite-uri` dropped and occasionally `fetch-completed-time` and `fetch-began-time` being dropped
i’m highly skeptical of the value of dropping keys at all and i’m tempted to get rid of this entirely, make all the keys persistent in other words
soliciting feedback (edited)
anjackson [2:39 PM]
My immediate reaction is HARD AGREE. It looks like Really Old Code though (https://github.com/internetarchive/heritrix3/blame/7d3eff5269142c77fa4b988396153f4c29d16caa/modules/src/main/java/org/archive/modules/CrawlURI.java#L878)
so the reasons for doing so may have been lost in time.
Hm, looking at usage: https://github.com/internetarchive/heritrix3/blob/a60b2ef3875ad47f57b0c6b3c0b19f86c40a12f7/engine/src/main/java/org/archive/crawler/frontier/WorkQueueFrontier.java#L954-L955
engine/src/main/java/org/archive/crawler/frontier/WorkQueueFrontier.java:954-955
curi.processingCleanup(); // lose state that shouldn't burden
// retry
I guess there's a concern that there may be state in there that is set during a fetch and may cause problems if the same CrawlURI is deferred?
But I'm not aware of anything in the fetch chain that behaves like that.
nlevitt [3:02 PM]
oh, i missed `CrawlURI.addDataPersistentMember(String)` et al. still...
Readme for Heritrix
- Introduction
- Crawl Operators!
- Getting Started
- Developer Documentation
- Release History
- License
1. Introduction
Heritrix is the Internet Archive's open-source, extensible, web-scale, archival-quality web crawler project. Heritrix (sometimes spelled heretrix, or misspelled or missaid as heratrix/heritix/heretix/heratix) is an archaic word for heiress (woman who inherits). Since our crawler seeks to collect and preserve the digital artifacts of our culture for the benefit of future researchers and generations, this name seemed apt.
2. Crawl Operators!
Heritrix is designed to respect the robots.txt http://www.robotstxt.org/wc/robots.html exclusion directives and META robots tags http://www.robotstxt.org/wc/exclusion.html#meta. Please consider the load your crawl will place on seed sites and set politeness policies accordingly. Also, always identify your crawl with contact information in the User-Agent so sites that may be adversely affected by your crawl can contact you or adapt their server behavior accordingly.
3. Getting Started
See the User Manual, available from https://github.com/internetarchive/heritrix3/wiki
4. Developer Documentation
See http://crawler.archive.org/articles/developer_manual/index.html. For REST API documentation, see https://heritrix.readthedocs.io/en/latest/api.html and for JavaDoc see http://builds.archive.org/javadoc/heritrix-3.2.0/ (n.b. Javadoc currently out of date).
5. Latest Releases
Information about releases can be found at https://github.com/internetarchive/heritrix3/wiki#latest-releases
6. License
Heritrix is free software; you can redistribute it and/or modify it under the terms of the Apache License, Version 2.0:
http://www.apache.org/licenses/LICENSE-2.0
Some individual source code files are subject to or offered under other licenses. See the included LICENSE.txt file for more information.
Heritrix is distributed with the libraries it depends upon. The libraries can be found under the 'lib' directory, and are used under the terms of their respective licenses, which are included alongside the libraries in the 'lib' directory.