open-nomad/client
Tim Gross 2d65dc418c
metrics: prevent negative counter from iowait decrease (#18849)
The iowait metric obtained from `/proc/stat` can under some circumstances
decrease. The relevant condition is when an interrupt arrives on a different
core than the one that gets woken up for the IO, and a particular counter in the
kernel for that core gets interrupted. This is documented in the man page for
the `proc(5)` pseudo-filesystem, and considered an unfortunate behavior that
can't be changed for the sake of ABI compatibility.

In Nomad, we get the current "busy" time (everything except for idle) and
compare it to the previous busy time to get the counter incremeent. If the
iowait counter decreases and the idle counter increases more than the increase
in the total busy time, we can get a negative total. This previously caused a
panic in our metrics collection (see #15861) but that is being prevented by
reporting an error message.

Fix the bug by putting a zero floor on the values we return from the host CPU
stats calculator.

Backport-of: #18835
2023-10-24 10:37:46 -04:00
..
allocdir Add `disable_file` parameter to job's `vault` stanza (#13343) 2023-06-23 15:15:04 -04:00
allochealth [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
allocrunner Only generate default workload identity once per alloc task - 1.6.x (#18783) 2023-10-17 13:06:20 -05:00
allocwatcher client: prevent watching stale alloc state (#18612) 2023-09-29 14:37:10 -07:00
config compliance: add headers with fixed copywrite tool (#17353) 2023-05-30 09:20:32 -05:00
consul [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
devicemanager fix multiple overflow errors in exponential backoff (#18200) 2023-08-15 14:39:09 -04:00
dynamicplugins Merge pull request #16836 from hashicorp/compliance/add-headers 2023-04-10 16:32:03 -07:00
fingerprint fingerprint: fix 'default' alias not added to interface specified by `network_interface` (#18096) (#18116) 2023-08-01 08:38:03 -04:00
interfaces [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
lib backport of commit 615e76ef3c23497f768ebd175f0c624d32aeece8 (#17993) 2023-07-19 13:31:14 -05:00
logmon [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
pluginmanager backport of commit 7bd5c6e84eef890cebdb404d9cb2e281919d4529 (#18555) 2023-09-21 17:16:14 -05:00
servers [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
serviceregistration backport of commit 05c332221471d39053eaecafe4832ddd6e1b3b89 (#18365) 2023-08-30 09:05:57 -05:00
state CSI: persist previous mounts on client to restore during restart (#17840) 2023-07-10 13:20:15 -04:00
stats metrics: prevent negative counter from iowait decrease (#18849) 2023-10-24 10:37:46 -04:00
structs backport of commit ca9e08e6b5eee00d055b9429df5976a70cdcb2d6 (#18813) 2023-10-20 08:35:54 +01:00
taskenv fix host port handling for ipv6 (#16723) 2023-04-20 19:53:20 -07:00
testutil Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
vaultclient vault: use an importable const for Vault header string. (#18740) (#18750) 2023-10-13 08:11:54 +01:00
acl.go backport of commit 668dc5f7a767e85d62379e3e02405d2afa93f1db (#18448) 2023-09-11 13:22:30 +01:00
acl_test.go backport of commit 668dc5f7a767e85d62379e3e02405d2afa93f1db (#18448) 2023-09-11 13:22:30 +01:00
agent_endpoint.go backport of commit ca9e08e6b5eee00d055b9429df5976a70cdcb2d6 (#18813) 2023-10-20 08:35:54 +01:00
agent_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
alloc_endpoint.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
alloc_endpoint_test.go Revert "hashicorp/go-msgpack v2 (#16810)" (#17047) 2023-05-01 17:18:34 -04:00
alloc_watcher_e2e_test.go cli: tls certs not created with correct SANs (#16959) 2023-05-22 09:31:56 -04:00
client.go client: prevent watching stale alloc state (#18612) 2023-09-29 14:37:10 -07:00
client_interface_test.go prioritized client updates (#17354) 2023-05-31 15:34:16 -04:00
client_stats_endpoint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
client_stats_endpoint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
client_test.go test: use correct parallel test setup func (#18326) (#18330) 2023-08-25 14:48:06 +01:00
csi_endpoint.go backport of commit 4895d708b438b42e52fd54a128f9ec4cb6d72277 (#18531) 2023-09-18 14:29:29 -05:00
csi_endpoint_test.go backport of commit 7bd5c6e84eef890cebdb404d9cb2e281919d4529 (#18555) 2023-09-21 17:16:14 -05:00
drain.go compliance: add headers with fixed copywrite tool (#17353) 2023-05-30 09:20:32 -05:00
drain_test.go compliance: add headers with fixed copywrite tool (#17353) 2023-05-30 09:20:32 -05:00
driver_manager_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
enterprise_client_oss.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
fingerprint_manager.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
fingerprint_manager_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
fs_endpoint.go backport of commit 14a38bee7bc4386e74157f6a99f3db7382d7e6a5 (#18275) 2023-08-21 16:34:32 -04:00
fs_endpoint_test.go backport of commit 14a38bee7bc4386e74157f6a99f3db7382d7e6a5 (#18275) 2023-08-21 16:34:32 -04:00
gc.go allocrunner: provide factory function so we can build mock ARs (#17161) 2023-05-12 13:29:44 -04:00
gc_test.go allocrunner: provide factory function so we can build mock ARs (#17161) 2023-05-12 13:29:44 -04:00
heartbeatstop.go allocrunner: provide factory function so we can build mock ARs (#17161) 2023-05-12 13:29:44 -04:00
heartbeatstop_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
meta_endpoint.go backport of commit d425c90e0f5acc6947c3d3e32a3e54942d1cd2bf (#18674) 2023-10-05 12:14:18 -04:00
meta_endpoint_test.go backport of commit d425c90e0f5acc6947c3d3e32a3e54942d1cd2bf (#18674) 2023-10-05 12:14:18 -04:00
node_updater.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
rpc.go client: send node secret with every client-to-server RPC (#16799) 2023-06-22 11:06:49 -04:00
rpc_test.go cli: tls certs not created with correct SANs (#16959) 2023-05-22 09:31:56 -04:00
testing.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
util.go client: de-duplicate alloc updates and gate during restore (#17074) 2023-05-11 09:05:24 -04:00