[Nepomuk] Review Request: Fix possibility of infinite loop

Simeon Bird bladud at gmail.com
Wed Nov 14 23:29:28 UTC 2012



> On Nov. 14, 2012, 5:20 p.m., Vishesh Handa wrote:
> > services/storage/resourcemerger.cpp, line 671
> > <http://git.reviewboard.kde.org/r/107318/diff/1/?file=94750#file94750line671>
> >
> >     I don't think this will do anything. The 'lastError' over here, refers to ResourceMerger's lastError. We need to be referring to the model's last error.

Of course, silly me. I'll fix it to check if createGraph returns empty. 


> On Nov. 14, 2012, 5:20 p.m., Vishesh Handa wrote:
> > services/storage/datamanagementmodel.cpp, line 2469
> > <http://git.reviewboard.kde.org/r/107318/diff/1/?file=94749#file94749line2469>
> >
> >     I'm not sure how this would loop forever. Plus, does this query actually ever give an error?

If there is an error from the query, it will return the empty Soprano::QueryResultIterator
So it.next() will be false, and the function will loop. If the error persists, it will loop forever.

The query can give an error - I wrote the patch because it happened to me. 
For some reason which I tried to debug but am now unable to reproduce at all, 
during a query slightly prior to this function, the socket connection to virtuoso was lost. 

But *just in case* it happens again, best not to loop.


- Simeon


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107318/#review21992
-----------------------------------------------------------


On Nov. 14, 2012, 4:19 a.m., Simeon Bird wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107318/
> -----------------------------------------------------------
> 
> (Updated Nov. 14, 2012, 4:19 a.m.)
> 
> 
> Review request for Nepomuk, Vishesh Handa and Sebastian Trueg.
> 
> 
> Description
> -------
> 
> Do not loop forever if there is an error executing the
>  query in createUri (for example, the connection to the
>  server died). Instead just return an empty url.
> 
> Also check for such an error with createGraph in ResourceMerger::merge.
> 
> This fixes a bug sort of introduced by b54cbaa5e00c1191cd2e66399aeb86a04ba85ef1.
> If something went wrong with virtuoso, xsession-errors would fill up the
> available space, because each loop called executeQuery and added an error message to the log.
> 
> 
> Diffs
> -----
> 
>   services/storage/datamanagementmodel.cpp 0a68513 
>   services/storage/resourcemerger.cpp 41d6548 
> 
> Diff: http://git.reviewboard.kde.org/r/107318/diff/
> 
> 
> Testing
> -------
> 
> The usual
> 
> 
> Thanks,
> 
> Simeon Bird
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20121114/a26b1733/attachment.html>


More information about the Nepomuk mailing list