Review Request 121913: Prevent querying attica with invalid categories

Aleix Pol Gonzalez aleixpol at kde.org
Thu Jan 8 12:07:39 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121913/#review73481
-----------------------------------------------------------



libmuon/backends/KNSBackend/KNSBackend.cpp
<https://git.reviewboard.kde.org/r/121913/#comment51144>

    Also you don't want to do ++it and erase, it should be one or the other.
    
    I suggest:
    for (auto it = m_categories.begin(); it != m_categories.end(); ) {
    if (it->isValid())
    it = m_categories.erase(it);
    else
    ++it;
    
    }


- Aleix Pol Gonzalez


On Jan. 8, 2015, 9:47 a.m., Harald Sitter wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121913/
> -----------------------------------------------------------
> 
> (Updated Jan. 8, 2015, 9:47 a.m.)
> 
> 
> Review request for Kubuntu and Muon Package Management Suite.
> 
> 
> Repository: muon
> 
> 
> Description
> -------
> 
> For as of right now unknown reasons looking for providers
> plasmoids.knsrc and getting opendesktop.org and then asking it for valid
> categories can return no category match for plasmoids.
> Which in turn makes us query for content pertaining to an invalid category.
> 
> What happens is that Provider::searchContents will come back with content
> matching every category of that provider (and every name), so we are
> looking at thousands of entries in 100-entry batches to receive which is
> neither fast nor efficient nor anything really.
> To safe guard against this sort of misbehavior explicitly remove all
> ?possible-category? entries that have not been matched up to a valid
> Attica::Category and return if there are none to search for.
> 
> Random background:
> m_categories keys get filled based on configuration values for possible
> resources, only in categoriesLoaded those entries are then matched up with
> actual categories the provider knows about. If one of the expected keys
> does not exist on the Provider we have a dangling entry in the Map ala
> <"Kitten", Category()>. There is no point in hurling those at Attica
> regardless of the cause that ultimately causes the present category
> problems. This is worsened by the fact that muon-updater needs to wait
> for all resources to fetching=false before it can display anything which
> means that having KSNBackend stuck in fetching on account of getting
> all the data a provider has on everything will block the entire upgrade
> and either making it appear as though muon is broken or there are no
> updates.
> 
> 
> Diffs
> -----
> 
>   libmuon/backends/KNSBackend/KNSBackend.cpp edc4f0ac6d2060930ab00c698a60cff74ad64107 
> 
> Diff: https://git.reviewboard.kde.org/r/121913/diff/
> 
> 
> Testing
> -------
> 
> without patch: muon-updater never shows anything (as long as opendesktop is resolved as provider, which actually doesn't happen all that often for some reason Oo)
> 
> patch & make & make install & muon-updater => everything awesome again
> 
> 
> Thanks,
> 
> Harald Sitter
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kubuntu-devel/attachments/20150108/51c25ede/attachment.html>


More information about the kubuntu-devel mailing list