Skip to content

safetymon: adds configurable decision making on locks, panics & shutdown#860

Merged
gbin merged 12 commits into
masterfrom
gbin/mux-safetymon
Feb 25, 2026
Merged

safetymon: adds configurable decision making on locks, panics & shutdown#860
gbin merged 12 commits into
masterfrom
gbin/mux-safetymon

Conversation

@gbin

@gbin gbin commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

We need a way in Copper to deal with fatal error like a lock, a panic or a monitor tripping with shutdown.

  1. this adds a way to add several monitors to your project.
  2. this "muxes" the decision from those monitors and take the safest one
  3. we added a safety monitor for std that just bails the process with a configurable copperlist timeout + a list of process error codes for an external watchdog to get it from there (for example restarting a simpler. safe-mode mission in case of emergency)

Related issues

  • Closes #

Changes

Testing

  • just fmt
  • just lint
  • just test
  • optional full just std-ci (if std/runtime paths are impacted)
  • optional full just nostd-ci (if embedded/no_std paths are impacted)
  • Other (please specify):

pro-tip: just with no parameters in the root defaults to just fmt, just lint, and just test.

Checklist

  • I have updated docs or examples where needed
  • I have added or updated tests where needed
  • I have considered platform impact (Linux/macOS/Windows/embedded)
  • I have considered config/logging changes (if applicable)
  • This change is not a breaking change (or I documented it below)

Breaking changes (if any)

Additional context

@gbin gbin changed the title Gbin/mux safetymon safetymon: adds a decision making on locks, panics & shutdown Feb 24, 2026
@gbin gbin changed the title safetymon: adds a decision making on locks, panics & shutdown safetymon: adds configurable decision making on locks, panics & shutdown Feb 24, 2026
@gbin gbin requested a review from makeecat February 24, 2026 21:49

@makeecat makeecat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. We need to note it in CHANGELOG.
Legacy monitor: configs are now silently dropped, resulting in no monitor being installed.

Apart from that, LGTM

@gbin

gbin commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator Author

@makeecat this is why reviews are useful. let's keep monitor and monitors after all. monitor for the quick "I want to test and see with my UI what is going on" and monitors when people needing to implement more production logic => this becomes non breaking and userfriendly.

gbin added 2 commits February 25, 2026 08:32
This is simpler for new users to deal with.
@gbin gbin merged commit 79821cb into master Feb 25, 2026
23 checks passed
@gbin gbin deleted the gbin/mux-safetymon branch February 25, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants