Skip to content

Robots.txt fetch no longer replaces the configured content limit - #2121

Open
abhinav-phi wants to merge 1 commit into
apache:mainfrom
abhinav-phi:issue-2087-robots-content-limit
Open

Robots.txt fetch no longer replaces the configured content limit#2121
abhinav-phi wants to merge 1 commit into
apache:mainfrom
abhinav-phi:issue-2087-robots-content-limit

Conversation

@abhinav-phi

Copy link
Copy Markdown
Contributor

Fixes #2087.

HttpRobotRulesParser.setConf put http.robots.content.limit (-1 by default) into the fetch metadata as http.content.limit, and HttpProtocol.getProtocolOutput applies that value unconditionally — so every robots.txt fetch ran with no limit at all, even when the operator configured a finite http.content.limit, although the shipped comment said the default was 'same as http.content.limit'. With no limit, the decompressed body is buffered until Constants.MAX_ARRAY_SIZE, just under 2 GB.

  • http.robots.content.limit: -1 now means 'inherit the global limit'; the key is only written into the fetch metadata when a robots-specific limit is configured
  • the shipped default of http.robots.content.limit is 524288 (512 kiB), the minimum the robots.txt RFC draft asks crawlers to fetch and parse
  • HttpProtocol ignores a metadata http.content.limit of -1 when the global limit is finite, so per-URL metadata can tighten the limit but not remove it

…he#2087)

HttpRobotRulesParser wrote http.robots.content.limit (-1 by default)
into the fetch metadata as http.content.limit, which HttpProtocol reads
unconditionally: a robots.txt fetch ran with no limit at all, even when
the operator had configured a finite http.content.limit, despite the
shipped comment saying the default was 'same as http.content.limit'.

- a http.robots.content.limit of -1 now means 'inherit the global
  limit' and the key is only written into the fetch metadata when a
  robots specific limit is configured
- the shipped default of http.robots.content.limit is 524288 (512 kiB),
  matching the minimum the robots.txt RFC draft asks crawlers to parse
- HttpProtocol ignores a metadata http.content.limit of -1 when the
  global limit is finite, so per-URL metadata can tighten the limit but
  not remove it
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.

The robots.txt fetch replaces the configured http.content.limit with no limit at all

1 participant