Commit Graph
2371 Commits
Author SHA1 Message Date
Alex Osborne d11d02eeac docs: Add 'Loading Cookies' section to config guide 2021-11-29 12:11:54 +09:00
Alex Osborne d63cb9af8b Merge pull request #444 from internetarchive/fix-dnsjava-selector-thread
FetchDNS: Keep dnsjava selector thread out of ToePool
2021-11-27 12:41:11 +09:00
Alex Osborne c46cfd1c31 Merge pull request #441 from netarchivesuite/iipc-master
Enabled configurable url-matching and extraction for sitemaps.
2021-11-02 10:34:26 +09:00
Alex Osborne 1832c5ef89 FetchDNS: Keep dnsjava selector thread out of ToePool
dnsjava will create its global selector thread on first DNS lookup.
Since the first lookup occurs on a toe thread then this will cause the
selector thead to join the job's toe thread group. This is a problem
because when the job is terminated ToePool sends an interrupt to all
threads in the thread group which the dnsjava selector thread is
not expected and never clears. The interrupted state then causes
select() to return immediately instead of sleeping so it consumes
100% CPU.

So workaround this by doing a dummy lookup when FetchDNS is loaded,
this ensures the first lookup happens on the web server thread that
handles the job build action instead of a toe thread.

Fixes: 045b2516da ("Update to latest version of dnsjava")
2021-11-01 16:15:27 +09:00
Alex Osborne 513c5fc487 FetchDNS: Move DNS cache init from CrawlController
Since the cache is global we only need to configure it once, not every
time we start a job. By moving it we keep the code that interfaces with
dnsjava centralized in FetchDNS.

Looks like dnsjava no longer uses a cleaner thread so remove the comment
referring to it.
2021-11-01 16:15:27 +09:00
Alex Osborne 17d760aa78 Remove obsolete Java < 1.6 version check
The parsing throws StringIndexOutOfBoundsException when the version
does not contain '.' such as version "17". This check could never
actually trigger as the class cannot even be loaded on 1.7 or earlier,
so there's no reason to keep it.

Fixes #439
2021-09-30 09:59:57 +09:00
Alex Osborne 698341a1d6 Github action: test against JDK 17 (LTS) instead of 16 2021-09-30 09:12:54 +09:00
Andrew Jackson c373c8e95e Re-sync changelog for 20210923 2021-09-23 23:58:54 +01:00
Andrew Jackson 024a7772b5 [maven-release-plugin] prepare for next development iteration 2021-09-23 22:08:33 +01:00
Andrew Jackson fedff1e2c7 [maven-release-plugin] prepare release 3.4.0-20210923 3.4.0-20210923 2021-09-23 22:08:30 +01:00
Andrew Jackson 16ab42973b Resync changelog. 2021-09-23 22:03:51 +01:00
Andy Jackson 2101a8c0f3 Merge pull request #434 from ukwa/safer-cookie-iteration
Add safer cookie iteration
2021-09-23 21:35:23 +01:00
Alex Osborne c1b1b11163 SECURITY.md: Use HTTPS for PANDORA contact link 2021-09-11 11:13:42 +09:00
Alex Osborne 5fcb9f4084 SECURITY.md: add mising 'the' 2021-09-11 10:59:49 +09:00
Alex Osborne 46d7e06bce Create SECURITY.md
Fixes #429
2021-09-11 10:51:27 +09:00
Alex Osborne 780abb0b1d docs: Update AdoptOpenJDK link as it has been rebranded Adoptium
https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/
2021-09-11 07:53:18 +09:00
Geertjan Wielenga cdfe1b32b4 Adopt is no more, moving to Temurin 2021-09-11 07:44:04 +09:00
Andy Jackson 3f4535a933 Add safer cookie iteration, as per #427. 2021-09-06 11:05:12 +01:00
Alex Osborne 47eebbc765 Merge pull request #431 from internetarchive/extractor-chrome-bug-fixes
ExtractorChrome bug fixes
2021-08-19 08:32:49 +09:00
Alex Osborne 3346428bf2 ExtractorChrome: Warn instead of throwing when response headers missing
Colin reported this exception. I'm uncertain how this can occur though
as FetchHTTP should populate the response headers. Perhaps a different
Fetch module was used?
2021-08-17 09:28:22 +09:00
Alex Osborne e93e457e19 ChromeWindow: Handle raw headers or headersText being unavailable
Colin encountered headersText being unavailable. (Maybe HTTP/2?)
2021-08-17 09:28:22 +09:00
Alex Osborne 6b19daf1d2 ExtractorChrome: Don't capture data: URIs
They are already captured as part of their containing document. There's
no need to record them separately.

#430
2021-08-17 09:28:22 +09:00
Alex Osborne cd30fbcc3c Merge pull request #424 from internetarchive/ui-cleanup
UI: Refactor duplicate template rendering code
2021-08-09 14:41:28 +09:00
Alex Osborne c34cb65683 ChromeClient: increase RPC timeout from 10 to 60 seconds
We hit a timeout during CI. The timeout is just a safety measure in case
the browser hangs so it doesn't hurt to have it higher. Using a higher
value will hopefully help if the system temporarily stalls for some
reason (garbage collection, IO issues, VM migration etc).
2021-08-09 14:37:45 +09:00
Andrew Jackson 0d46239c2d Update changelog following release. 2021-08-03 10:40:01 +01:00
Andrew Jackson ddb695abad [maven-release-plugin] prepare for next development iteration 2021-08-03 09:56:26 +01:00
Andrew Jackson ba44cce7f2 [maven-release-plugin] prepare release 3.4.0-20210803 3.4.0-20210803 2021-08-03 09:56:20 +01:00
Andrew Jackson 0b48699948 Update changelog 2021-08-03 09:53:30 +01:00
Alex Osborne eb67cfb215 Merge pull request #423 from internetarchive/dont-extract-data-uris
Don't extract data URIs
2021-08-03 07:43:17 +09:00
Andrew Jackson 8fe92c3437 Update changlog. 2021-08-02 13:36:45 +01:00
Andy Jackson 4d5b2dc3fe Merge pull request #397 from ukwa/upgrade-httpclient-4-5
Upgrade httpclient to 4.5
2021-08-02 09:19:30 +01:00
Alex Osborne ed13a2b0c5 UI: Pull duplicate getEngine() methods up to BaseResource
Each direct subclass of BaseResource defines an identical getEngine()
method so let's pull it up to BaseResource. We can also don't need the
type cast anymore as BaseResource.getApplication() does it for us.
2021-08-01 17:19:35 +09:00
Alex Osborne 2719d022d5 UI: Refactor duplicated template code into a common render() helper
We remove the calls to setCharacterSet(UTF_8) since
WriterRepresentation's constructor does that anyway.
2021-08-01 17:19:35 +09:00
Alex Osborne 4233a930f0 UI: Use a single instance of Freemarker for the whole application
So we don't need to configure it separately in every resource class that
uses HTML templates.
2021-08-01 15:23:38 +09:00
Alex Osborne d72d847d92 Merge pull request #421 from internetarchive/toe-thread-interrupt-fix
ToeThread: ensure currentCuri is finished before exiting
2021-07-31 16:21:14 +09:00
Alex Osborne 82b4360962 Merge pull request #418 from internetarchive/fix-keytool-on-jdk16
JDK 16 compatibility
2021-07-31 16:20:45 +09:00
Alex Osborne 33a5d70209 ExtractorSitemap: Use logUriError() helper like other extractors 2021-07-30 15:57:09 +09:00
Alex Osborne 1032c0ec40 ExtractorHTML: Avoid allocating strings for data: URIs when possible
Data URIs can be very large. ExtractorHTML mostly works with off-heap
CharSequences so by delaying the conversion of outlinks to strings
until after filtering out data URIs we can potentially avoid some
very large String allocations.
2021-07-30 15:57:09 +09:00
Alex Osborne e33e1ff398 Extractor: ignore data URIs when adding outlinks 2021-07-30 15:57:09 +09:00
Alex Osborne 91ef23eddf ExtractorPDFContext, ExtractorYoutubeDL: use addOutlink() helper method 2021-07-30 14:25:34 +09:00
Alex Osborne 466c10b7a4 Merge pull request #416 from internetarchive/extractor-chrome-replay-responses
ExtractorChrome: reduce request duplication between browser and frontier
2021-07-27 20:26:46 +09:00
Alex Osborne 721e89ca10 ToeThread: ensure currentCuri is finished before exiting
Thread interruption and certain other exceptions can cause a toe thread
to exit without informing the frontier that the current CrawlURI is
finished. This causes the job to get permanently stuck in the STOPPING
state.

This change adds a section to the finally block that will finish any
unfinished CrawlURI.

We also move the continueCheck() call after setCurrentCuri() to ensure
there's no window where InterruptedException can be thrown after the
frontier returns the next CrawlURI but before it gets assigned to
currentCuri.

Fixes #420
2021-07-26 15:26:09 +09:00
Alex Osborne f0d9385120 GitHub actions: run test suite on JDK 16 too 2021-07-25 14:11:13 +09:00
Alex Osborne f4bd5d1015 Upgrade Groovy to latest stable version (3.0.8) for JDK 16 compatibility
Fixes #419
2021-07-25 14:11:13 +09:00
Alex Osborne 636948cb09 KeyTool wrapper: fallback to running keytool as a subprocess on JDK 16+
JDK 16 defaults to --illegal-access=deny which means trying to call
KeyTool via reflection now throws IllegalAccessException.

Fixes #417
2021-07-25 11:15:45 +09:00
Alex Osborne 014fb2dcad ExtractorChrome: have frontier consider browser-fetched uris included
Since we now run extractors on subresources there's no reason to
schedule and refetch them again.

Note that duplicate fetches can still occur if the URI was already
scheduled or if the browser itself refetches the resource.
2021-07-24 17:25:21 +09:00
Alex Osborne bbae794b47 ExtractorChrome: run extractors on subresources captured by the browser
This ensures we discover links in subresources even if the browser
doesn't happen to load them. For example a CSS file might link to images
that the browser won't load as they're gated by media queries.
2021-07-24 17:16:44 +09:00
Alex Osborne 8ec7ce3363 ExtractorChrome: replay the recorded CrawlURI response to the browser
By intercepting the browser's request and fulfilling it using the
response previously recorded by FetchHTTP we avoid sending duplicate
requests for the CrawlURI to the web server.

A size limit (maxReplayLength) is applied as a safety measure since the
browser's Fetch.fulfillRequest API requires us to load the entire
response body into memory.

Note: This only applies to the main CrawlURI. The browser can still
make duplicate requests when loading sub-resources. Solving this for
sub-resources will require implementing the ability to read back
previously written WARC records.
2021-07-23 17:38:56 +09:00
Alex Osborne ab19efa9d6 Merge pull request #414 from internetarchive/maven-assembly-plugin-3.3.0
Upgrade maven-assembly-plugin to 3.3.0 to fix file permissions
2021-07-22 11:21:35 +09:00
Adam Miller d2d9d4f157 Adding configurable MaxLogFileSize option to BdbModule 2021-07-19 15:49:56 +09:00