-
Notifications
You must be signed in to change notification settings - Fork 7
enhancement(core): Erlang/OTP-style supervisor system #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
dc6c05f
to
343860d
Compare
343860d
to
9840350
Compare
ed00477
to
74574e9
Compare
e2c007a
to
feb74bb
Compare
feb74bb
to
125372c
Compare
125372c
to
4a63c4e
Compare
581b0f6
to
bf3527b
Compare
Regression Detector (Agent Data Plane)Regression Detector ResultsRun ID: 0546c77b-62eb-48c2-825b-d04173cd8996 Baseline: 0957bb3 Optimization Goals: ✅ No significant changes detected
|
perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
---|---|---|---|---|---|---|
➖ | quality_gates_rss_dsd_medium | memory utilization | +0.30 | [+0.12, +0.47] | 1 | |
➖ | quality_gates_rss_dsd_heavy | memory utilization | +0.29 | [+0.19, +0.38] | 1 | |
➖ | quality_gates_rss_idle | memory utilization | +0.17 | [+0.15, +0.19] | 1 | |
➖ | dsd_uds_10mb_3k_contexts_throughput | ingress throughput | +0.03 | [-0.02, +0.08] | 1 | |
➖ | dsd_uds_512kb_3k_contexts_throughput | ingress throughput | +0.00 | [-0.01, +0.02] | 1 | |
➖ | quality_gates_rss_dsd_ultraheavy | ingress throughput | +0.00 | [-0.04, +0.04] | 1 | |
➖ | dsd_uds_1mb_3k_contexts_throughput | ingress throughput | -0.00 | [-0.02, +0.01] | 1 | |
➖ | dsd_uds_100mb_3k_contexts_throughput | ingress throughput | -0.01 | [-0.08, +0.06] | 1 | |
➖ | quality_gates_rss_dsd_low | memory utilization | -0.07 | [-0.22, +0.07] | 1 | |
➖ | dsd_uds_500mb_3k_contexts_throughput | ingress throughput | -3.41 | [-3.54, -3.27] | 1 |
Bounds Checks: ✅ Passed
perf | experiment | bounds_check_name | replicates_passed | links |
---|---|---|---|---|
✅ | quality_gates_rss_dsd_heavy | memory_usage | 10/10 | |
✅ | quality_gates_rss_dsd_low | memory_usage | 10/10 | |
✅ | quality_gates_rss_dsd_medium | memory_usage | 10/10 | |
✅ | quality_gates_rss_dsd_ultraheavy | memory_usage | 10/10 | |
✅ | quality_gates_rss_idle | memory_usage | 10/10 |
Explanation
Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%
Performance changes are noted in the perf column of each table:
- ✅ = significantly better comparison variant performance
- ❌ = significantly worse comparison variant performance
- ➖ = no significant change in performance
A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".
For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.
-
Its configuration does not mark it "erratic".
Regression Detector (Agent Data Plane w/ Checks)Regression Detector ResultsRun ID: 9136ff2d-887d-4d14-b93e-b9227939eed7 Baseline: 0957bb3 Optimization Goals: ✅ No significant changes detected
|
perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
---|---|---|---|---|---|---|
➖ | quality_gates_rss_idle | memory utilization | +0.02 | [+0.01, +0.04] | 1 | |
➖ | quality_gates_rss_basic | memory utilization | -0.14 | [-0.16, -0.13] | 1 |
Bounds Checks: ✅ Passed
perf | experiment | bounds_check_name | replicates_passed | links |
---|---|---|---|---|
✅ | quality_gates_rss_basic | memory_usage | 10/10 | |
✅ | quality_gates_rss_idle | memory_usage | 10/10 |
Explanation
Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%
Performance changes are noted in the perf column of each table:
- ✅ = significantly better comparison variant performance
- ❌ = significantly worse comparison variant performance
- ➖ = no significant change in performance
A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".
For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.
-
Its configuration does not mark it "erratic".
Regression Detector LinksADP Experiment Result Links
ADP && Checks Experiment Result Links
|
//! Processes have a few key attributes and invariants: | ||
//! | ||
//! - every process is a future that runs as an independent asynchronous task on a Tokio runtime | ||
//! - every process has a unique numerical identifier and a semi-unique name | ||
//! | ||
//! Processes cannot run by themselves, however. They must be _supervised_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming, unlike Erlang processes saluki-core processes do not have a mailbox / input queue associated for message passing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed later, no mailbox. Probably worth adding this to the documentation in case someone -- like myself -- comes along with an Erlang mental model inappropriately.
/// Process names will be sanitized if they contain invalid characters, such as hyphens or spaces. Invalid characters | ||
/// will be replaced with underscores. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not opposed, just curious why we don't reject invalid names outright? Haven't confirmed yet, it's possible the intention here is for process names to arrive via user config, in which case this does make some sense.
// TODO: Erlang/OTP defaults to always trying to restart a process, even if it doesn't terminate due to a | ||
// legitimate failure. It does allow configuring this behavior on a per-process basis, however. We don't | ||
// support dynamically adding child processes, which is the only real use case I can think of for having | ||
// non-long-lived child processes... so I think for now, we're OK just always try to restart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -0,0 +1,175 @@ | |||
use std::time::Duration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how the API works. Probably worth developing a lint or something to confirm that processes actually check their shutdown signal properly. Shame we don't have the ability to preempt.
Summary
This PR introduces a new runtime system in
saluki-core
modeled after Erlang/OTP's supervision trees, a powerful design pattern for building fault-tolerant systems composed of many interdependent "processes" in a way that they can recover from failure.Supervision trees are explained succinctly by the Erlang/OTP documentation, but generally: we have a collection of processes (asynchronous tasks) that have some level of fallibility, and we want to -- where possible -- maximize their resilience by allowing them to be restarted if they fail. Supervision trees approach this from the perspective of declaring a "specification" that describes how to create the process (in our case, building the
Future
that is spawned) and then adding those specifications to a supervisor, which is responsible for managing those processes, restarting them when die, giving up if certain restart limits are hit, and so on.While we lack a lot of the power of Erlang itself, in terms of what Erlang/OTP's supervisors can build on top of, even having the basics provides us a lot of leeway for building things in a more fault-tolerant way:
We're intentionally only implementing many of the basics here -- worker specification, restart strategy, nested supervisors, orderly shutdown, etc -- but will add enhanced capabilities in future iterations, such as runtime telemetry/introspection, dynamic workers, and more.
Change Type
How did you test this PR?
N/A
References
AGTMETRICS-233