vector icon indicating copy to clipboard operation
vector copied to clipboard

enhancement(config): Remove the watcher's coupling to SIGHUP / prepare for automatic Windows config reload

Open darklajid opened this issue 1 year ago • 4 comments
trafficstars

Right now the watcher is broken/unimplemented for Windows¹ and a large part of the reason for that might be how it works:

  • the watcher subscribes to filesystem events (crate: notify²)
  • the watcher raises a unix signal (SIGHUP) on detecting changes
  • the signal handler (again, unix only) reacts to SIGHUP with an internal reload signal
  • (vector magically reloads/compares the configs)

With these changes that unix signal dependency is removed

  • the watcher clones a SignalTx to emit its very own signals
  • the watcher sends an internal reload signal on detecting changes
  • (vector magically reloads/compares the configs)

All of this should also work on Windows, has nothing to do with unix signals anymore.

I slightly modified the tests to not just wait for any Ok, but to state explicitly what signal we expect to receive.

As I am currently (and ironically..) on Linux, I haven't been able to verify the functionality on Windows yet, I'm trying to build a VM for that at the moment. I also expect fun challenges to build the dependencies on Windows.

For Linux, the tests remain green and this seems to be a transparent change to me: I don't think that affects any users, a SIGHUP works the same way it did before and just the filesystem change events don't go through that indirection anymore.

①: It fails outright/intentionally on Windows with an error pointing to https://github.com/vectordotdev/vector/issues/938, but it's unclear why this can't work ②: Notify officially supports native filesystem watches (and - as on all platforms - a polling fallback) on Windows

darklajid avatar Aug 02 '24 09:08 darklajid

CLA assistant check
All committers have signed the CLA.

bits-bot avatar Aug 02 '24 09:08 bits-bot

Apologies for the clippy failures. Will fix in an hour or so

BPodszun avatar Aug 05 '24 14:08 BPodszun

Building on Windows has been a bit of a pain (arguably worse because I do it in a VM?). So far I have confirmed that this PR

  • builds successfully
  • the build above does what it should (i.e. vector -w -c vector.toml will pick up changes if the file is modified)

what is outstanding due to the insane amount of time it takes for me to compile stuff in this setup is a cargo test watcher run - that's currently building while I am sword-fighting on my office chair in the hallways.. Stiill, based on the observation of the cargo build --release binary from above I am already quite confident that this not only removes the whole weird SIGHUP dependency, but also magically allows Windows users to get hot-reloads.

darklajid avatar Aug 06 '24 14:08 darklajid

Thanks for opening this @darklajid ! We'll review it shortly.

jszwedko avatar Aug 09 '24 17:08 jszwedko

Regression Detector Results

Run ID: f48168f9-ecf1-4073-b88d-cf9aa448161c Metrics dashboard

Baseline: e90cecef2598ae267ed6f645356da6f8a494a827 Comparison: c3cd2325e180907c1c9e1e8547547e0e9b240df8

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

No significant changes in experiment optimization goals

Confidence level: 90.00% Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI links
file_to_blackhole egress throughput +14.36 [+6.47, +22.24]

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI links
file_to_blackhole egress throughput +14.36 [+6.47, +22.24]
socket_to_socket_blackhole ingress throughput +2.00 [+1.91, +2.08]
fluent_elasticsearch ingress throughput +1.99 [+1.49, +2.48]
datadog_agent_remap_datadog_logs ingress throughput +1.59 [+1.41, +1.76]
syslog_loki ingress throughput +1.50 [+1.41, +1.60]
datadog_agent_remap_blackhole ingress throughput +1.23 [+1.12, +1.34]
http_to_s3 ingress throughput +0.26 [-0.01, +0.53]
http_to_http_acks ingress throughput +0.23 [-1.09, +1.55]
http_to_http_noack ingress throughput +0.19 [+0.10, +0.28]
datadog_agent_remap_datadog_logs_acks ingress throughput +0.09 [-0.10, +0.28]
http_to_http_json ingress throughput +0.07 [+0.01, +0.13]
splunk_hec_to_splunk_hec_logs_noack ingress throughput +0.00 [-0.10, +0.10]
splunk_hec_to_splunk_hec_logs_acks ingress throughput +0.00 [-0.11, +0.11]
splunk_hec_indexer_ack_blackhole ingress throughput -0.00 [-0.09, +0.09]
http_text_to_http_json ingress throughput -0.06 [-0.18, +0.06]
syslog_regex_logs2metric_ddmetrics ingress throughput -0.07 [-0.22, +0.08]
syslog_humio_logs ingress throughput -0.29 [-0.42, -0.16]
syslog_log2metric_splunk_hec_metrics ingress throughput -0.39 [-0.49, -0.28]
otlp_grpc_to_blackhole ingress throughput -0.45 [-0.56, -0.33]
otlp_http_to_blackhole ingress throughput -0.45 [-0.60, -0.31]
datadog_agent_remap_blackhole_acks ingress throughput -0.47 [-0.60, -0.35]
syslog_splunk_hec_logs ingress throughput -0.50 [-0.60, -0.41]
syslog_log2metric_humio_metrics ingress throughput -0.54 [-0.71, -0.38]
http_elasticsearch ingress throughput -0.69 [-0.85, -0.53]
splunk_hec_route_s3 ingress throughput -0.92 [-1.23, -0.60]
syslog_log2metric_tag_cardinality_limit_blackhole ingress throughput -0.99 [-1.13, -0.85]

Explanation

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:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. 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.

  3. Its configuration does not mark it "erratic".

github-actions[bot] avatar Aug 28 '24 15:08 github-actions[bot]