Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryExec: abort before exec is ignored. #2394

Closed
Aklakan opened this issue Apr 7, 2024 · 0 comments · Fixed by #2395
Closed

QueryExec: abort before exec is ignored. #2394

Aklakan opened this issue Apr 7, 2024 · 0 comments · Fixed by #2395
Labels

Comments

@Aklakan
Copy link
Contributor

Aklakan commented Apr 7, 2024

Version

5.1.0-SNAPSHOT

What happened?

The following test does not raise the expected QueryCancelledException, in fact, abort() is ignored.

    @Test(expected = QueryCancelledException.class)
    public void test_Cancel_API_5() {
        Model model = ModelFactory.createDefaultModel();
        model.add(RDF.type, RDF.type, RDF.type);
        try (QueryExecution qe = QueryExecutionFactory.create("SELECT * { ?s ?p ?o }", model)) {
            qe.abort();
            ResultSetFormatter.consume(qe.execSelect());
        }
    }

Note, that because abort may be called asynchronously, abort signals must be handled even if the e.g. the thread that called execSelect() has not finished the internal QueryIterator setup yet.

Relevant output and stacktrace

No response

Are you interested in making a pull request?

Yes

@Aklakan Aklakan added the bug label Apr 7, 2024
Aklakan added a commit to Aklakan/jena that referenced this issue Apr 7, 2024
Aklakan added a commit to Aklakan/jena that referenced this issue Apr 7, 2024
@afs afs closed this as completed in #2395 Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant