FeatureFuel
9

Allow configuration of the date parsing regex timeout

Source: paperless-ngx/paperless-ngx#13654 · opened by @joe-tofu
Description Since v3, date detection no longer finds a date in documents whose extracted text exceeds roughly 11,500 characters (measured on a slow CPU, see below). Affected documents silently fall back to the import date as created. There is no user-visible error — only a WARNING in the server log. This is a regression introduced by putting the date search under the shared regex timeout: v2.20.15 — src/documents/parsers.py, standard re module, no timeout is possible: v3.0.5 — src/documents/plugins/date_parsing/regex_parser.py, regex module with a timeout: src/documents/regex.py: Two problems follow from this: 1. The limit is too tight for long documents. DATE_REGEX is a large alternation; matching it costs roughly 8.7 µs per character on the hardware below. Anything past ~11,500 characters exceeds 100 ms and is aborted. 2. The limit cannot be raised. MATCH_REGEX_TIMEOUT_SECONDS is read via getattr, but no such setting is defined anywhere in src/paperless/settings/, so it…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests