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
+7
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;
@@ -381,6 +384,7 @@ public abstract interface class kotlinx/coroutines/experimental/Job : kotlin/cor
381
384
public abstract fun isActive ()Z
382
385
public abstract fun isCancelled ()Z
383
386
public abstract fun isCompleted ()Z
387
+
public abstract fun isFailed ()Z
384
388
public abstract fun join (Lkotlin/coroutines/experimental/Continuation;)Ljava/lang/Object;
385
389
public abstract fun plus (Lkotlinx/coroutines/experimental/Job;)Lkotlinx/coroutines/experimental/Job;
386
390
public abstract fun start ()Z
@@ -440,7 +444,9 @@ public final class kotlinx/coroutines/experimental/NonCancellable : kotlin/corou
440
444
public static final field INSTANCE Lkotlinx/coroutines/experimental/NonCancellable;
441
445
public fun attachChild (Lkotlinx/coroutines/experimental/Job;)Lkotlinx/coroutines/experimental/DisposableHandle;
442
446
public fun cancel (Ljava/lang/Throwable;)Z
447
+
public fun cancelChild (Lkotlinx/coroutines/experimental/Job;)V
443
448
public synthetic fun cancelChildren (Ljava/lang/Throwable;)V
449
+
public fun childFailed (Ljava/lang/Throwable;)Z
444
450
public fun getCancellationException ()Ljava/util/concurrent/CancellationException;
445
451
public fun getChildren ()Lkotlin/sequences/Sequence;
446
452
public fun getCompletionException ()Ljava/lang/Throwable;
@@ -452,6 +458,7 @@ public final class kotlinx/coroutines/experimental/NonCancellable : kotlin/corou
452
458
public fun isActive ()Z
453
459
public fun isCancelled ()Z
454
460
public fun isCompleted ()Z
461
+
public fun isFailed ()Z
455
462
public fun join (Lkotlin/coroutines/experimental/Continuation;)Ljava/lang/Object;
456
463
public fun plus (Lkotlinx/coroutines/experimental/Job;)Lkotlinx/coroutines/experimental/Job;
0 commit comments