Skip to content

Share parser execution and preserve cancellation signals - #2626

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/parser-execution-interruption
Sep 13, 2026
Merged

Share parser execution and preserve cancellation signals#2626
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/parser-execution-interruption

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

Waiting for a parser task currently swallows the caller’s interruption and leaves the submitted task running. The single-statement and statement-list utilities duplicate the same execution code, so both paths have this behavior.

This change shares the executor submission/wait logic, cancels the task when the caller is interrupted, restores the caller’s interrupt flag, and makes the parser stop flag visible to the worker thread. Timeout, interruption, and cancellation stop the convenience APIs from submitting a complex-parser retry; syntax errors retain the existing retry path. The supplied executor remains caller-owned and public method signatures are unchanged.

Validation: ./gradlew check passed, including deterministic tests for both entry points, interruption, zero-timeout cancellation, retry counts, and reuse of a caller-owned executor after valid and invalid SQL.

@manticore-projects
manticore-projects merged commit 35105a0 into JSQLParser:master Sep 13, 2026
10 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you very much for improving this!

Btw, I am suggesting:

  1. to release 5.4 stable first (I have asked @JSQLParser/owners already)
  2. then remove the SimpleExpression completely, everything becomes an Expression
  3. then remove the Complex vs Simple Parsing as well.

It should not be needed anymore since we got the PRATT parser and the grammar fixed.

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.

2 participants