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

Always to a live lookup of version info instead of caching. #860

Merged
merged 1 commit into from
Aug 21, 2015

Conversation

pwittrock
Copy link
Contributor

This PR changes how VersionInfo is served
old: lookup/create and cache the version info at manager creation time
new: lookup/create the version info each time it is requested

This is necessary to correctly report the VersionInfo in the event that the docker daemon is not running at the time the manager is created. This case may be encountered when cAdvisor is started in the same program that initializes the docker daemon / container bridge.

@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@cadvisorJenkinsBot
Copy link
Collaborator

Can one of the admins verify this patch?

@vishh
Copy link
Contributor

vishh commented Aug 20, 2015

ok to test

@@ -658,7 +656,9 @@ func (m *manager) GetMachineInfo() (*info.MachineInfo, error) {
}

func (m *manager) GetVersionInfo() (*info.VersionInfo, error) {
return &m.versionInfo, nil
// TODO: Consider caching this and periodically updating. The VersionInfo may change if
// the docker daemon is started after the cAdvisor client is created
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Add to TODO - Might also be helpful to cache, so we can return last known docker version if docker is down at the time of query.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@rjnagal
Copy link
Contributor

rjnagal commented Aug 20, 2015

LGTM.

Thanks for fixing it, @pwittrock !

@vishh
Copy link
Contributor

vishh commented Aug 20, 2015

LGTM

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@pwittrock
Copy link
Contributor Author

Thanks everyone. PTAL. Feedback addressed.

@vishh
Copy link
Contributor

vishh commented Aug 20, 2015

retest this please

@vishh
Copy link
Contributor

vishh commented Aug 20, 2015

@cadvisorJenkinsBot: retest this please

@pwittrock pwittrock force-pushed the no_cache_versioninfo branch from 9970983 to b7bbefd Compare August 20, 2015 23:49
@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@pwittrock
Copy link
Contributor Author

Recent push was to squash the commit for the PR review comments

@pwittrock pwittrock closed this Aug 20, 2015
@pwittrock pwittrock reopened this Aug 20, 2015
@rjnagal
Copy link
Contributor

rjnagal commented Aug 21, 2015

LGTM

rjnagal added a commit that referenced this pull request Aug 21, 2015
Always to a live lookup of version info instead of caching.
@rjnagal rjnagal merged commit 39290ee into google:master Aug 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants