m/n/core: fix pstore runnable
Make it first signal healthy, then done. Otherwise it seems to panic
sometimes. Also move all signalling code to the end of the runnable.
Change-Id: I4911f94aafbd324a49f7ff5af9904a778ddb8dce
Reviewed-on: https://review.monogon.dev/c/monogon/+/774
Tested-by: Jenkins CI
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
diff --git a/metropolis/node/core/pstore.go b/metropolis/node/core/pstore.go
index 01f6cfd..857488a 100644
--- a/metropolis/node/core/pstore.go
+++ b/metropolis/node/core/pstore.go
@@ -12,10 +12,6 @@
// keeps the pstore from overflowing the generally limited storage it has.
func dumpAndCleanPstore(ctx context.Context) error {
logger := supervisor.Logger(ctx)
- // Retrying this is extremely unlikely to result in any change and is most
- // likely just going to generate large amounts of useless logs obscuring
- // errors.
- supervisor.Signal(ctx, supervisor.SignalDone)
dumps, err := pstore.GetKmsgDumps()
if err != nil {
logger.Errorf("Failed to recover logs from pstore: %v", err)
@@ -31,5 +27,10 @@
if cleanErr != nil {
logger.Errorf("Failed to clear pstore: %v", err)
}
+ // Retrying this is extremely unlikely to result in any change and is most
+ // likely just going to generate large amounts of useless logs obscuring
+ // errors.
+ supervisor.Signal(ctx, supervisor.SignalHealthy)
+ supervisor.Signal(ctx, supervisor.SignalDone)
return nil
}