diff options
author | eldritch horrors <pennae@lix.systems> | 2024-10-02 15:39:17 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-10-04 17:49:57 +0000 |
commit | 5b1715e63349541c1d021f6426b2ad67a0bf518f (patch) | |
tree | 3cae908d6d4686ba70932022321802a55167828d /src/libstore/build/derivation-goal.hh | |
parent | 0b29859cfe00e321875d87d7305c99f2d301a475 (diff) |
libstore: forbid addWantedGoals when finished
due to event loop scheduling behavior it's possible for a derivation
goal to fully finish (having seen all paths it was asked to create),
but to not notify the worker of this in time to prevent another goal
asking the recently-finished goal for more outputs. if this happened
the finished goal would ignore the request for more outputs since it
considered itself fully done, and the delayed result reporting would
cause the requesting goal to assume its request had been honored. if
the requested goal had finished *properly* the worker would recreate
it instead of asking for more outputs, and this would succeed. it is
thus safe to always recreate goals once they are done, so we now do.
Change-Id: Ifedd69ca153372c623abe9a9b49cd1523588814f
Diffstat (limited to 'src/libstore/build/derivation-goal.hh')
-rw-r--r-- | src/libstore/build/derivation-goal.hh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstore/build/derivation-goal.hh b/src/libstore/build/derivation-goal.hh index 7505409c0..1e2f9b55c 100644 --- a/src/libstore/build/derivation-goal.hh +++ b/src/libstore/build/derivation-goal.hh @@ -74,6 +74,12 @@ struct DerivationGoal : public Goal struct InputStream; /** + * Whether this goal has completed. Completed goals can not be + * asked for more outputs, a new goal must be created instead. + */ + bool isDone = false; + + /** * Whether to use an on-disk .drv file. */ bool useDerivation; @@ -249,7 +255,7 @@ struct DerivationGoal : public Goal /** * Add wanted outputs to an already existing derivation goal. */ - void addWantedOutputs(const OutputsSpec & outputs); + bool addWantedOutputs(const OutputsSpec & outputs); /** * The states. |