You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Roman Puchkovskiy (Jira)" <ji...@apache.org> on 2022/09/30 07:58:00 UTC

[jira] [Updated] (IGNITE-17787) Fix node failures due to CancelledKeyException

     [ https://issues.apache.org/jira/browse/IGNITE-17787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Puchkovskiy updated IGNITE-17787:
---------------------------------------
    Summary: Fix node failures due to CancelledKeyException  (was: Fix node failures due to java.nio.channels.CancelledKeyException)

> Fix node failures due to CancelledKeyException
> ----------------------------------------------
>
>                 Key: IGNITE-17787
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17787
>             Project: Ignite
>          Issue Type: Bug
>          Components: networking
>            Reporter: Roman Puchkovskiy
>            Assignee: Roman Puchkovskiy
>            Priority: Major
>             Fix For: 2.15
>
>
> In GridNioServer, sessions may be moved between workers to balance the load. When a session is moved from worker A, the corresponding SelectionKey is cancelled. When a session is moved back, the selector is registered with the corresponding channel.
> Key cancellation is an async procedure. It gets really executed during selection operation (select() or selectNow()). It might happen that a session is moved from worker A (key cancellation is requested), then it gets moved back to worker A, but the worker did not have a chance to invoke select() (due to contention or some other reason). In such a case, we'll try to re-register a selector with a channel for which a key is still registered, which will cause a CancelledKeyException to be thrown (which may crash the node if a corresponding failure handler is used).
> We can fix this by invoking selectNow() just after requesting key cancellation. This will make sure the cancellation request is actually handled before the session lands to another worker.



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