apache / apache/jena

REGEX Expression Evaluation errors can flood the logs

Open
#1,817 1 comment 0 reactions 0 assignees View on GitHub
enhancement improvement
Dominant language
Java
Stars
1.4k
Forks
712
Avg merge
15h 41m
Merged PRs (30d)
53

Description

### Version

4.x

### What happened?

User report on the mailing list - https://lists.apache.org/thread/4kfpx9wpm38p3kbdh78dmgpoz2ckm4s1

A query with a faulty `REGEX` on a large dataset resulted in massive log output because every single attempt to evaluate the expression produces an `ExprEvalException` and `QueryIterFilterExpr` logs every single one of those

Workaround suggested on list is to disable the offending logger but since this is enabled by default it effectively provides a potential DoS vector against Jena based systems. Logging could be made more intelligent in several ways:

- Suppressing duplicate messages
- Not logging specific classes of expression evaluation failures
- Logging at a lower level that would not be output by default

### Relevant output and stacktrace

See mailing list thread - https://lists.apache.org/thread/91qvxshm4njnd657g966yrbq8kmsy9ok

### Are you interested in making a pull request?

Yes

Contributor guide

Open the contributing guide

Research direction

Start with QueryIterFilterExpr and the two linked mailing-list reports to understand how REGEX evaluation failures are currently logged. Determine a logging behavior that prevents repeated failures from flooding logs while retaining useful diagnostics, then verify that faulty REGEX queries no longer produce unbounded output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.