We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d9fb68 commit a833181Copy full SHA for a833181
kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Job.kt
@@ -296,7 +296,11 @@ private class CancelFutureOnCompletion(
296
job: Job,
297
val future: Future<*>
298
) : JobNode(job) {
299
- override fun invoke(reason: Throwable?) { future.cancel(true) }
+ override fun invoke(reason: Throwable?) {
300
+ // Don't interrupt when cancelling future on completion, because no one is going to reset this
301
+ // interruption flag and it will cause spurious failures elsewhere
302
+ future.cancel(false)
303
+ }
304
override fun toString() = "CancelFutureOnCompletion[$future]"
305
}
306
0 commit comments