You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Konstantin Orlov (Jira)" <ji...@apache.org> on 2022/11/14 10:11:00 UTC

[jira] [Commented] (IGNITE-17998) ItSqlAsynchronousApiTest#closeSession is unstable.

    [ https://issues.apache.org/jira/browse/IGNITE-17998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17633653#comment-17633653 ] 

Konstantin Orlov commented on IGNITE-17998:
-------------------------------------------

I would say, {{ExecutionCancelledException}} is more relevant for this case.

{{CursorClosedException}} is more about accessing a cursor which were _explicitly_ closed.

{{ExecutionCancelledException}} is about accessing a cursor which were _implicitly_ closed.

In the test we close the session, and all related cursors should be closed implicitly.

> ItSqlAsynchronousApiTest#closeSession is unstable.
> --------------------------------------------------
>
>                 Key: IGNITE-17998
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17998
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 3.0.0-alpha5
>            Reporter: Evgeny Stanilovsky
>            Assignee: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> ItSqlAsynchronousApiTest#closeSession is unstable.
> {noformat}
> org.opentest4j.AssertionFailedError: Exception is neither of a specified class, nor has a cause of the specified class: class org.apache.ignite.sql.SqlException
> 	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:43)
> 	at org.junit.jupiter.api.Assertions.fail(Assertions.java:146)
> 	at org.apache.ignite.internal.testframework.IgniteTestUtils.assertThrowsWithCause(IgniteTestUtils.java:284)
> 	at org.apache.ignite.internal.testframework.IgniteTestUtils.assertThrowsWithCause(IgniteTestUtils.java:264)
> 	at org.apache.ignite.internal.sql.api.ItSqlAsynchronousApiTest.closeSession(ItSqlAsynchronousApiTest.java:541)
> {noformat}
> h3. {*}UPDATE{*}:
> Since the test shows that the current behavior of "fetchNextPage" is unstable on a closed session, we decided to investigate other possible use-cases.
> h4. The results are as follows:
> The behavior of the "{{{}execute{}}}*" session methods on a closed session is correct - we throw a {{SqlException}} with the message "{{{}Session is closed{}}}" for any local execution.
> "{{{}execute{}}}*" returns sync or async resultset. The "{{{}hasRowSet{}}} / {{affectedRows}} / {{wasApplied}} / {{metadata}} / {{{}close{}}}" methods are generic and give the expected results on a closed session with no errors.
> The results of the rest of the methods are presented in the following table.
> ||ResultSet type||Method||Result|| ||
> || || ||*Data absent*||*Data present (pageSize=2)*||
> |*{{async}}*|*{{CurrentPage}} (hasNext)*|{{false}}|{{true}}|
> | |*{{currentPageSize}}*|0|2|
> | |*{{hasMorePages}}*|false|true|
> | |*{{fetchNextPage}}*|{{SqlException}} IGN-SQL-1 There are no more pages.|Expected: {{CursorClosedException}}
> {color:#aa1111}Currently: {{No exception}} or {{CursorClosedException}} or {{ExecutionCancelledException}}{color}|
> | | | | |
> |*{{sync}}*|*{{hasNext}}*|{{false}}|{{true}}|
> | |*next*|{{NoSuchElementException}}|{color:#676700}4 rows (initially, 2 pages are preloaded)
> then {{CursorClosedException}}
> {{(dependent on "fetchNextPage" so currently similar unstable behavior is possible).}}{color}|



--
This message was sent by Atlassian Jira
(v8.20.10#820010)