You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix exception aggregation to ensure atomic handling of exceptions
* Removed legacy onFinishing handler support from JobSupport.
- It is no longer needed, because handleJobException covers #208
* Fixed bugs that were masked by cancelling parent from onFinishing.
* Consistent "Finishing" state was introduced in internal machinery:
- Job enters finishing state when it is failing or it is completing
and has children
- Finishing state cleanly aggregates all failures, tracks cancellation
and completion status
* Job.isFailed is introduced as a consistent way to query the "failing"
state of the job that was previously only implicitly available via
invokeOnCompletion handler (cause != null means a failed job) and
the documentation for both Job & Deferred is updated to reflect that.
* Source-incompatible change: Job.invokeOnCompletion boolean parameter is
change to onFailing. Such handlers are now invoked as soon as the job
starts failing and the root cause exception of the failure is consistently
passed to all the handlers.
* The following internal methods were introduced to facilitate this:
- Job.failParent(exception) is used by child to signal failure to parent
- Job.cancelChild(parentJob) is used by parent to cancel child.
* Child never aggregates exception received from it parent, but uses
it as it root cause if there is no other exception.
* JobSupport.handleJobException() logic for launch/actor is split into:
- failParent - can be invoked multiple times on race;
- handleJobException which is invoked exactly once.
* Exception materiazization is much lazier now, which should
significantly improve performance when cancelling large hierarchies.
* Other minor perf improvements in JobSupport code.
Fixes#585
Copy file name to clipboardExpand all lines: binary-compatibility-validator/reference-public-api/kotlinx-coroutines-core.txt
+5
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
public abstract class kotlinx/coroutines/experimental/AbstractCoroutine : kotlin/coroutines/experimental/Continuation, kotlinx/coroutines/experimental/CoroutineScope, kotlinx/coroutines/experimental/Job {
2
+
protected final field parentContext Lkotlin/coroutines/experimental/CoroutineContext;
2
3
public fun <init> (Lkotlin/coroutines/experimental/CoroutineContext;Z)V
3
4
public synthetic fun <init> (Lkotlin/coroutines/experimental/CoroutineContext;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
4
5
public final fun getContext ()Lkotlin/coroutines/experimental/CoroutineContext;
@@ -369,7 +370,9 @@ public abstract interface class kotlinx/coroutines/experimental/Job : kotlin/cor
369
370
public static final field Key Lkotlinx/coroutines/experimental/Job$Key;
370
371
public abstract fun attachChild (Lkotlinx/coroutines/experimental/Job;)Lkotlinx/coroutines/experimental/DisposableHandle;
371
372
public abstract fun cancel (Ljava/lang/Throwable;)Z
373
+
public abstract fun cancelChild (Lkotlinx/coroutines/experimental/Job;)V
372
374
public abstract synthetic fun cancelChildren (Ljava/lang/Throwable;)V
375
+
public abstract fun childFailed (Ljava/lang/Throwable;)Z
373
376
public abstract fun getCancellationException ()Ljava/util/concurrent/CancellationException;
374
377
public abstract fun getChildren ()Lkotlin/sequences/Sequence;
375
378
public abstract fun getCompletionException ()Ljava/lang/Throwable;
@@ -440,7 +443,9 @@ public final class kotlinx/coroutines/experimental/NonCancellable : kotlin/corou
440
443
public static final field INSTANCE Lkotlinx/coroutines/experimental/NonCancellable;
441
444
public fun attachChild (Lkotlinx/coroutines/experimental/Job;)Lkotlinx/coroutines/experimental/DisposableHandle;
442
445
public fun cancel (Ljava/lang/Throwable;)Z
446
+
public fun cancelChild (Lkotlinx/coroutines/experimental/Job;)V
443
447
public synthetic fun cancelChildren (Ljava/lang/Throwable;)V
448
+
public fun childFailed (Ljava/lang/Throwable;)Z
444
449
public fun getCancellationException ()Ljava/util/concurrent/CancellationException;
445
450
public fun getChildren ()Lkotlin/sequences/Sequence;
446
451
public fun getCompletionException ()Ljava/lang/Throwable;
0 commit comments