Skip to content
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

Ensuring that we are not emitting stats when handle is nil #1723

Merged
merged 2 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion client/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down