diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ef553f4f51..b27e126ab3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ BUG FIXES: * client: Prevent race when persisting state file [GH-1682] * client: Artifact download failures will be retried before failing tasks [GH-1558] + * client: Fix a crash related to stats publishing when driver hasn't started + yet [GH-1723] * client/fingerprint: Fix inconsistent CPU MHz fingerprinting [GH-1366] * discovery: Fix old services not getting removed from consul on update [GH-1668] diff --git a/client/task_runner.go b/client/task_runner.go index b68fbeb65c6..1f7d86051fc 100644 --- a/client/task_runner.go +++ b/client/task_runner.go @@ -502,8 +502,11 @@ func (r *TaskRunner) collectResourceUsageStats(stopCollection <-chan struct{}) { for { select { case <-next.C: - ru, err := r.handle.Stats() next.Reset(r.config.StatsCollectionInterval) + if r.handle == nil { + continue + } + ru, err := r.handle.Stats() if err != nil { // We do not log when the plugin is shutdown as this is simply a