Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 114B5200BE9 for ; Mon, 26 Dec 2016 13:35:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 10142160B40; Mon, 26 Dec 2016 12:35:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 62444160B2A for ; Mon, 26 Dec 2016 13:34:59 +0100 (CET) Received: (qmail 91090 invoked by uid 500); 26 Dec 2016 12:34:58 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 91074 invoked by uid 99); 26 Dec 2016 12:34:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Dec 2016 12:34:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 78D8B2C022B for ; Mon, 26 Dec 2016 12:34:58 +0000 (UTC) Date: Mon, 26 Dec 2016 12:34:58 +0000 (UTC) From: "Vladimir Ozerov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-4480) Incorrect cancellation semantics in IgniteFuture MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 26 Dec 2016 12:35:00 -0000 [ https://issues.apache.org/jira/browse/IGNITE-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15778258#comment-15778258 ] Vladimir Ozerov commented on IGNITE-4480: ----------------------------------------- Right, but {{cancel()}} should always lead to {{CancelledException}} from user perspective always. You may or may not perform some special actions in response to cancel, but from the outside behavior must be consistent. This topic was discussed on concurrency-interest multiple times. And bottom line is that correct design is when execution is decoupled from cancellation handling. This is what I essentially propose. > Incorrect cancellation semantics in IgniteFuture > ------------------------------------------------ > > Key: IGNITE-4480 > URL: https://issues.apache.org/jira/browse/IGNITE-4480 > Project: Ignite > Issue Type: Task > Components: general > Affects Versions: 1.8 > Reporter: Vladimir Ozerov > Fix For: 2.0 > > > *Problem* > Normally, if user invoke "cancel()" on future, he expects that it will be completed immediately. E.g. this is how JDK {{CompletableFuture}} works. However, this is not the case for Ignite - we inform user about cancellation through flag, which is also not set properly in most cases. > *Solution* > 1) {{cancel()}} must complete future with special "CancellationException" immediately. > 2) {{isCancelled()}} method should be either removed or deprecated. > 3{ We should add {{isCompletedExceptionally()}} method which will return {{true}} in case future was completed with any kind of exception. This will work similar to JDK {{CompletableFuture}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)