Code review comment for lp:~marcustomlinson/unity-scopes-api/metadata_isaggregator_attr

Revision history for this message
Michi Henning (michihenning) wrote :

For SA's, we are probably a lot safer, because these aren't constructed willy-nilly on the fly.

For GA's, I think that's a real problem. What is this going to look like to the user? They make an aggregator that introduces a loop, and the queries will time out, without producing results, most likely. The user gets to see something that simply doesn't work, with no real idea of how to diagnose or remedy the problem.

Too many layers cannot cause deadlock. Rather, they'll cause queries to time out.

Even if we have loop detection of some kind, how should it behave? Detecting the loop doesn't solve the problem because, when we detect a loop, the user is still presented with a query that doesn't work. What we would need isn't loop detection, but "loop repair". The only way to fix this that I can see would be to track all scopes that are currently involved in a query and, if a subquery() goes to a scope that is already in the loop, not forward that subquery.

Doing this will be somewhat intrusive. At the very least, we would need a change at the protocol level that adds the IDs of all scopes involved so far to the search request on the wire.

« Back to merge proposal