# Semgrep confusing Timeout error on rules with too many matches max_match_per_file
Semgrep times out scanning a small (~6K lines) JS file in Azure Pipelines PR analysis, with a confusing "Timeout" error. The real cause is a rule producing too many matches, not a slow scan. Increasing the timeout alone does not help.
## How to handle it
Raise the per-file match ceiling via the engine env var: `export SEMGREP_CORE_EXTRA="-max_match_per_file 200000"` and set the scan timeout to 0 (unlimited) if your pipeline allows it. The reporter confirmed this combination got their scan through. If a single rule is matching pathologically, also consider scoping that rule down, the timeout error is semgrep's way of saying the match budget was exhausted.
Source: https://github.com/semgrep/semgrep/issues/2411