Skip to content

Commit

Permalink
Ensuring that we are not emitting stats when handle is nil (#1723)
Browse files Browse the repository at this point in the history
* Ensuring that we are not emitting stats when handle is nil

* Updated the changelog
  • Loading branch information
diptanu committed Sep 20, 2016
1 parent 60e114a commit 0150970
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 0150970

Please sign in to comment.