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

Kirill Anisimov commented on IGNITE-26959:
------------------------------------------

h3. What's the problem

When thin client connection was disconnected, 
{{ClientConnectionContext.onDisconnected()}} triggered 
{{ClientResourceRegistry.clean()}} to close all registered resources. If 
closing one of the resources failed, the cleanup iteration was interrupted and 
the remaining resources were not processed. 

In addition, {{ClientCacheQueryContinuousHandle.close()}} decremented the 
cursor counter only after {{cur.close()}} completed successfully. When 
{{cur.close()}} failed during node stopping, the cursor counter wasn't 
decremented, which could leave the connection context in inconsistent state.

This behaviour caused instability in disconnect handling and led to failures in 
the continuous query disconnect scenario. 
h3. Fix

{{ClientResourceRegistry.clean()}} was reworked as follows:
 * remove each resource from the registry before attempting to close it;
 * catch exceptions thrown during resource closing;
 * log the failure in debug mode;
 * instead of stopping on the first error, continue cleaning up for the 
remaining resources.

{{{{{}C{}}}lientCacheQueryContinuousHandle.close()}} was also updated so that 
cursor count decrement is performed in a {{finally}} block. This guarantees 
that the cursor counter is updated even if {{cur.close()}} fails.

> Test TestLongEventsProcessingDisconnect from C++ test suite is broken in 
> master
> -------------------------------------------------------------------------------
>
>                 Key: IGNITE-26959
>                 URL: https://issues.apache.org/jira/browse/IGNITE-26959
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Sergey Chugunov
>            Assignee: Kirill Anisimov
>            Priority: Major
>              Labels: ise
>             Fix For: 2.19
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> According to 
> [history|https://ci2.ignite.apache.org/project.html?projectId=IgniteTests24Java8&testNameId=-5112321148966502234&tab=testDetails&branch_IgniteTests24Java8=%3Cdefault%3E]
>  this test is broken in master branch since 22 October 2025.
> One possible culprit is a [refactoring 
> commit|https://github.com/apache/ignite/commit/0b5b218254dd49695e83ea1baa1319ffabc6ffa0#diff-37f047534e3320d3378962125b64f64028d3e51a25c694d66e83ea84f49b55df]
>  that broke behavior of catching exceptions when cleaning up resources, but 
> more investigation is needed.



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

Reply via email to