internal/core/adt: fix panic on remnant notifications
When using the -e flag, a node may be evaluated
again. If that node leaked and was not garbage
collected, it may end up resending notifications.
If the receiving node was already cleared, this
caused a panic.
We now just check if a node has been finalized
before sending notifications. Alternatively, we
could prevent a node from being collected when
it still may receive notifications. This is not
necessary for this case.
By adding this code, though, we may paper over
a bug when a notification is dropped during normal
evaluation. We add a counter, to catch such cases.
Fixes #4004
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I21d66f8ece11f08ba949a02028d4dab56e818b19
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1219264
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>