> I fail to understand this; I have not tested STS extensively.
> Is it not the case that an inner scope will be cancelled when its parent 
> scope is cancelled?
> The forked subtask would be joining the inner scope; will this inner join not 
> be cancelled when the outer join is cancelled?
> In what sense does an inner scope not participate in the same error handling 
> as the outer scope?

Yes, you’re right, if the parent scope is cancelled, this will interrupt the 
thread running the child scope. If the child scope is waiting on scope.join() 
(or starts to wait on that method soon enough), the child scope will be 
properly cancelled and shut down as well.

However, the problem we’re considering here is failure in the child scope, or 
rather that moving any blocking logic from the parent’s scope body, to the 
child scope body, doesn’t solve anything. Failure of forks in the child scope 
won’t interrupt (cancel) the child scope’s body, just as it wouldn’t interrupt 
(cancel) the parent’s scope body. Given, of course, that the child/parent scope 
body is blocked on something else than scope.join().

Adam

-- 
Adam Warski

https://warski.org

Reply via email to