Bug 1415711

Summary: DNF should not automatically download repodata over metered connections
Product: [Fedora] Fedora Reporter: Patrick Uiterwijk <puiterwijk>
Component: dnfAssignee: rpm-software-management
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: rawhideCC: packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-2.1.0-1.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-16 11:32:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Patrick Uiterwijk 2017-01-23 13:56:10 UTC
I have no way to tell DNF not to download repodata over specific connections, either in NM or anywhere else.
This leads to DNF downloading the repodata up to once per hour, with 50MB.
If I'm on a metered or slow connection I might not want it to do this, as I may need the bandwith and/or data allowance.

It would be great if I could mark a connection as metered or DNF could detect that a connection is slow and then no automatically update the cache.

Comment 1 Honza Silhan 2017-02-01 16:26:20 UTC
from some discussion on fedora devel list:

On Tue, Nov 1, 2016 at 9:59 AM, Miroslav Suchý <msuchy> wrote:
> Dne 31.10.2016 v 12:55 Tom Hughes napsal(a):
>> The problem, as I believe has been repeatedly explained, is that you don't really have any idea whether the connection
>> is metered. Yes you may be trying to guess by considering things like 3G connections as metered but that is an extremely
>> poor proxy for whether a connection is metered.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1112230

Then new DNF config option ~sync_metadata_unmetred_conn_only, set to
True by default could be a solution. I am just skeptical about DNF
depending on NetworkManager.

Seems like bug 1112230 is fixed now so it may be possible.

Comment 2 Igor Gnatenko 2017-02-01 16:30:55 UTC
(In reply to Honza Silhan from comment #1)
> from some discussion on fedora devel list:
> 
> On Tue, Nov 1, 2016 at 9:59 AM, Miroslav Suchý <msuchy> wrote:
> > Dne 31.10.2016 v 12:55 Tom Hughes napsal(a):
> >> The problem, as I believe has been repeatedly explained, is that you don't really have any idea whether the connection
> >> is metered. Yes you may be trying to guess by considering things like 3G connections as metered but that is an extremely
> >> poor proxy for whether a connection is metered.
> >
> > https://bugzilla.redhat.com/show_bug.cgi?id=1112230
> 
> Then new DNF config option ~sync_metadata_unmetred_conn_only, set to
> True by default could be a solution. I am just skeptical about DNF
> depending on NetworkManager.
Recommends: pythonX-networkmanager ?

Comment 3 Igor Gnatenko 2017-02-01 16:31:25 UTC
I was thinking about implementation and only tricky part would be "which connection librepo is going to use?".