{"action":"created","issue":{"url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines/issues/515","repository_url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines","labels_url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines/issues/515/comments","events_url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines/issues/515/events","html_url":"https://github.com/Kotlin/kotlinx.coroutines/issues/515","id":353908683,"node_id":"MDU6SXNzdWUzNTM5MDg2ODM=","number":515,"title":"Future.await doesn't propagate cancelation signal to future","user":{"login":"svasilinets","id":618966,"node_id":"MDQ6VXNlcjYxODk2Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/618966?v=4","gravatar_id":"","url":"https://api.github.com/users/svasilinets","html_url":"https://github.com/svasilinets","followers_url":"https://api.github.com/users/svasilinets/followers","following_url":"https://api.github.com/users/svasilinets/following{/other_user}","gists_url":"https://api.github.com/users/svasilinets/gists{/gist_id}","starred_url":"https://api.github.com/users/svasilinets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svasilinets/subscriptions","organizations_url":"https://api.github.com/users/svasilinets/orgs","repos_url":"https://api.github.com/users/svasilinets/repos","events_url":"https://api.github.com/users/svasilinets/events{/privacy}","received_events_url":"https://api.github.com/users/svasilinets/received_events","type":"User","site_admin":false},"labels":[{"id":846419469,"node_id":"MDU6TGFiZWw4NDY0MTk0Njk=","url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines/labels/design","name":"design","color":"8a9edb","default":false},{"id":396785979,"node_id":"MDU6TGFiZWwzOTY3ODU5Nzk=","url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-24T19:56:36Z","updated_at":"2018-08-26T21:47:20Z","closed_at":null,"author_association":"NONE","body":"invokeOnCancellation only clears a reference to future in that coroutine\r\n\r\nhttps://github.com/Kotlin/kotlinx.coroutines/blob/07c5ce48c03b417f1808ab04cd29f76235ed4ce7/integration/kotlinx-coroutines-guava/src/ListenableFuture.kt#L129"},"comment":{"url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines/issues/comments/416074809","html_url":"https://github.com/Kotlin/kotlinx.coroutines/issues/515#issuecomment-416074809","issue_url":"https://api.github.com/repos/Kotlin/kotlinx.coroutines/issues/515","id":416074809,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjA3NDgwOQ==","user":{"login":"svasilinets","id":618966,"node_id":"MDQ6VXNlcjYxODk2Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/618966?v=4","gravatar_id":"","url":"https://api.github.com/users/svasilinets","html_url":"https://github.com/svasilinets","followers_url":"https://api.github.com/users/svasilinets/followers","following_url":"https://api.github.com/users/svasilinets/following{/other_user}","gists_url":"https://api.github.com/users/svasilinets/gists{/gist_id}","starred_url":"https://api.github.com/users/svasilinets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svasilinets/subscriptions","organizations_url":"https://api.github.com/users/svasilinets/orgs","repos_url":"https://api.github.com/users/svasilinets/repos","events_url":"https://api.github.com/users/svasilinets/events{/privacy}","received_events_url":"https://api.github.com/users/svasilinets/received_events","type":"User","site_admin":false},"created_at":"2018-08-26T21:47:20Z","updated_at":"2018-08-26T21:47:20Z","author_association":"NONE","body":"I notice it accidentally, just exploring this topic, because we're going to expose ListenableFuture in our java api and have corresponding suspend functions in Kotlin apis. \r\n\r\nI thought and browse code a bit  and now I think that default behavior for ListenableFuture.await() should be propagate cancelation (instead of current one), for following reasons:\r\n\r\n1. This is [default behavior](https://github.com/google/guava/blob/99ada5a3181f509981f6dd350e72ec8327162810/guava/src/com/google/common/util/concurrent/Futures.java#L80) for guava. Implementation examples: \r\n[TimeoutFuture](https://github.com/google/guava/blob/99ada5a3181f509981f6dd350e72ec8327162810/guava/src/com/google/common/util/concurrent/TimeoutFuture.java#L168). It is implementation of Futures.withTimeout().\r\n[AggregateFuture](https://github.com/google/guava/blob/99ada5a3181f509981f6dd350e72ec8327162810/guava/src/com/google/common/util/concurrent/AggregateFuture.java#L64) that backs Futures.allAsList and others.\r\n2.  it is default behavior for coroutines (= Deferred) \r\n\r\nSo it will be weird that this behavior breaks on the edge of two frameworks that have the same defaults. \r\n\r\nPS. In guava there is special [nonCancellationPropagating](https://github.com/google/guava/blob/99ada5a3181f509981f6dd350e72ec8327162810/guava/src/com/google/common/util/concurrent/Futures.java#L753) if anyone wants to stop propagation. \r\n"}}
{"actor":{"display_login":"svasilinets"}}