summaryrefslogtreecommitdiff
path: root/apex
diff options
context:
space:
mode:
author Steve Elliott <steell@google.com> 2024-12-09 13:20:29 -0500
committer Steve Elliott <steell@google.com> 2024-12-09 13:25:06 -0500
commit2570a8df7fc493a7e06a543a37d0fd28a3359b54 (patch)
treef3e56fb91e81d344fdce9040316eee793a9b9660 /apex
parent2b08d466d90c8a0b1483e7a5389d7228da1718a1 (diff)
[kairos] fix early termination of state accumulation
Calling CompletableJob.complete() puts the Job in the *completing* state, where it stays until all child Jobs complete. If there are no child Jobs, then it completes immedidately. We want to do this because it allows the structured concurrency tree to be cleaned up once it is marked as complete. No doing so means that a build scope is *running* until it is explicitly cancelled. If child Jobs complete normally, the parent Job stays *running*, wasting some memory. However, because we also use the Job as a bridge between the pure Kairos world, and the impure external world. Specifically, when the Job completes (or is cancelled), we use that signal to terminate any ongoing state accumulation. This is fine if it is the semantic end of the scope, but if the scope is still "semantically" valid, but just not running any more coroutines (via effects), then we still want state accumulation to continue, even if we want to mark the Job as complete so that the coroutines infra can free up some memory. For now, lets just disable the optimization, as the cost probably isn't too high. Flag: EXEMPT unused Test: atest kairos-tests Change-Id: I9dd3575451cb146237ce74c12498e2c764576a1e
Diffstat (limited to 'apex')
0 files changed, 0 insertions, 0 deletions