From 87c0c92ac74f13db5ff42a12dd680a645afaceb7 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Fri, 31 Jan 2020 14:17:15 -0500 Subject: [PATCH 1/2] Pass stats interval colleciton to executor This fixes a bug where executor based drivers emit stats every second, regardless of user configuration. When serializing the Stats request across grpc, the nomad agent dropped the Interval value, and then executor uses 1s as a default value. --- drivers/shared/executor/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/shared/executor/client.go b/drivers/shared/executor/client.go index 67bb5cb57001..057518e1f9fa 100644 --- a/drivers/shared/executor/client.go +++ b/drivers/shared/executor/client.go @@ -107,7 +107,9 @@ func (c *grpcExecutorClient) Version() (*ExecutorVersion, error) { } func (c *grpcExecutorClient) Stats(ctx context.Context, interval time.Duration) (<-chan *cstructs.TaskResourceUsage, error) { - stream, err := c.client.Stats(ctx, &proto.StatsRequest{}) + stream, err := c.client.Stats(ctx, &proto.StatsRequest{ + Interval: int64(interval), + }) if err != nil { return nil, err } From aec066c997aadc380b779ae5c89384bbc675ce42 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Fri, 31 Jan 2020 14:22:08 -0500 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3425e2fe6d3f..a9a133119af8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ BUG FIXES: * consul: Fixed a bug where script-based health checks would fail if the service configuration included interpolation. [[GH-6916](https://github.com/hashicorp/nomad/issues/6916)] * consul/connect: Fixed a bug where Connect-enabled jobs failed to validate when service names used interpolation. [[GH-6855](https://github.com/hashicorp/nomad/issues/6855)] * driver/exec: Fixed a bug where systemd cgroup wasn't removed upon a task completion [[GH-6839](https://github.com/hashicorp/nomad/issues/6839)] + * drivers: Fixed a bug where exec, java, and raw_exec drivers collected and emited stats every second regardless of the telemetry config [[GH-7043](https://github.com/hashicorp/nomad/issues/7043)] * server: Fixed a deadlock that may occur when server leadership flaps very quickly [[GH-6977](https://github.com/hashicorp/nomad/issues/6977)] * scheduler: Fixed a bug that caused evicted allocs on a lost node to be stuck in running. [[GH-6902](https://github.com/hashicorp/nomad/issues/6902)] * scheduler: Fixed a bug where `nomad job plan/apply` returned errors instead of a partial placement warning for ineligible nodes. [[GH-6968](https://github.com/hashicorp/nomad/issues/6968)]