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

Cache results from meltdown checker #656

Merged
merged 2 commits into from Feb 23, 2019

Conversation

Projects
None yet
2 participants
@alexAubin
Copy link
Member

commented Feb 19, 2019

The problem

c.f. YunoHost/issues#1304

Solution

Cache the results from meltdown checker instead of re-running the script everytime a diagnosis is done...

The cache is stored in /tmp/ with the idea that it shall be cleared upon a reboot (which might change the result from the script). Also since we might want to change what we do with this diagnosis, I check the modification time of the cached file against /var/log/dpkg.log such that the diagnosis is re-ran if there was an upgrade (of yunohost for example)

PR Status

Tested and working

How to test

Run yunohost tools diagnosis --debug a few time, you should see a message indicating the result is write to / read from the cached file

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :
Show resolved Hide resolved src/yunohost/tools.py Outdated
@Psycojoker
Copy link
Member

left a comment

LGTM, thx <3

@Psycojoker

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

I think there are quite other things that could be optimized in diagnosis (like, I've added "yunohost service regenconf --dry-run -d" which is super slow :/)

I don't think that the super sequential architecture of this command is really good at scaling :/

But I guess this will be changed when we'll move to the global diagnosis system (one day ™)

@alexAubin

This comment has been minimized.

Copy link
Member Author

commented Feb 19, 2019

I've added "yunohost service regenconf --dry-run -d" which is super slow :/

Uuh where though ? o.O

But yup the global diagnosis system should be more modular with cache and rainbows and stuff, someday™

@Psycojoker

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

I've added "yunohost service regenconf --dry-run -d" which is super slow :/

Uuh where though ? o.O

Here

diagnosis['private']['regen_conf'] = service_regen_conf(with_diff=True, dry_run=True)

@alexAubin

This comment has been minimized.

Copy link
Member Author

commented Feb 19, 2019

Ah yes, but that's for the "private" diagnosis so it happens less often ;P

@Psycojoker

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

Yes, fortunately 😅

@alexAubin alexAubin merged commit 318e4b0 into stretch-unstable Feb 23, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@alexAubin alexAubin deleted the cache-meltdown-checker-results branch Feb 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.