Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No link extraction on URI not successfully downloaded #161

Merged

Conversation

kris-sigur
Copy link
Collaborator

During a test crawl I noticed a bunch of alerts like the following:

SEVERE: unable to get replay prefix string (in thread 'ToeThread #38: dns:arcland.is'; in processor 'extractorHtml')
java.io.IOException: chunked stream ended unexpectedly
    at org.apache.commons.httpclient.ChunkedInputStream.getChunkSizeFromInputStream(ChunkedInputStream.java:252)
    at org.apache.commons.httpclient.ChunkedInputStream.nextChunk(ChunkedInputStream.java:221)
    at org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:176)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.Reader.read(Reader.java:140)
    at org.archive.util.Recorder.getContentReplayPrefixString(Recorder.java:513)
    at org.archive.util.Recorder.getContentReplayPrefixString(Recorder.java:500)
    at org.archive.modules.extractor.ExtractorHTML.shouldExtract(ExtractorHTML.java:713)
    at org.archive.modules.extractor.ContentExtractor.shouldProcess(ContentExtractor.java:77)
    at org.archive.modules.Processor.process(Processor.java:140)
    at org.archive.modules.ProcessorChain.process(ProcessorChain.java:131)
    at org.archive.crawler.framework.ToeThread.run(ToeThread.java:148)

Turns out they are caused by the ExtractorHTML.shouldExtract() method trying to peek at the start of the content stream.

At first I thought it was just down to this being a DNS entry, but I quickly realized that these all related to non-successful DNS lookups.

Which got me thinking, why are we even trying to extract links from non-successful CrawlURIs?

So this PR adds a check to the ContentExtractor.shouldProcess() to immediately skip any non-successfully downloaded URIs. Avoids these errors and saves a little, otherwise wasted, effort.

Kristinn Sigurðsson added 2 commits May 3, 2016 14:40

Verified

This commit was signed with the committer’s verified signature. The key has expired.
sei-vsarvepalli Vijay Sarvepalli

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@nlevitt nlevitt merged commit bb10b4a into internetarchive:master Jun 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants