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

Call 'apt-get update' only once per run #32862

Closed
DenisBY opened this issue Apr 26, 2016 · 5 comments
Closed

Call 'apt-get update' only once per run #32862

DenisBY opened this issue Apr 26, 2016 · 5 comments
Labels
Bug broken, incorrect, or confusing behavior Execution-Module P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale State-Module
Milestone

Comments

@DenisBY
Copy link

DenisBY commented Apr 26, 2016

Why not to use something like semaphore or flag to call 'apt-get update' only once per job run? What the reason to call it on each pkg.installed or pkg.latest?

@DenisBY
Copy link
Author

DenisBY commented Apr 26, 2016

I found

def __gen_rtag():
    '''
    Return the location of the refresh tag
    '''
    return os.path.join(__opts__['cachedir'], 'pkg_refresh')

but how to use it? I see apt-get update for each state with pkg.* during one job run

@mitar
Copy link
Contributor

mitar commented Apr 28, 2016

I just wanted to open such ticket. This is really bad. It slows down the whole process. We have many packages in our states which we want to have pkg.latest with refresh set to true. And then it does apt-get update so many times that sometimes our IP gets blocked from repositories. :-(

@jfindlay jfindlay added Execution-Module State-Module Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps labels Apr 28, 2016
@jfindlay jfindlay added this to the Approved milestone Apr 28, 2016
@jfindlay
Copy link
Contributor

@DenisBY, @mitar, thanks for reporting. It seems that the pkg_refresh logic in the state module may not be working if the cache is regenerated for every state run.

@mitar
Copy link
Contributor

mitar commented Jan 15, 2017

If I understand the latest state, based on #34098, if refresh is not set at all, then apt-get update is called only once per run? And with #34914 one can set cache_valid_time to configure how long to cache, if one does use refresh set to true?

@stale
Copy link

stale bot commented Aug 24, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Aug 24, 2018
@stale stale bot closed this as completed Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Execution-Module P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale State-Module
Projects
None yet
Development

No branches or pull requests

3 participants