-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Consistently return a Deferred in the descriptor cache #3455
Conversation
I have a horrible suspicion we might have been doing this on purpose so that we don't incur the cost of wrapping/unwrapping the deferred |
@erikjohnston it returning bare values feels like it's only working on accident, tbh :S |
We so consistently use inlineCallbacks that it'd be fine. Though I agree its fairly awful |
@erikjohnston it hid a bug in push_bulk_rules, where it didn't yield, only called, and relied on there being a cached value! |
(which meant anything that called this made the tests fail as it was expecting a value, not a deferred) |
As Erik has said, this was somewhat deliberate: see #2075 which made it so. It's also worth noting that I do agree that an inconsistent return type is horrific and a source of fragility like this, though if Erik's claims on #2075 are to be believed, that may be outweighed by the performance hit. On the other hand, I don't really understand why it makes so much difference. Surely the overhead of a completed Deferred should be negligible? It means that the next level up does a bit of extra work, but it's really not much. In conclusion, I guess we should decide how much of a performance hit this would cause. If it's negligible, then I am very happy for us to start unwinding #2075 and go for consistent return types not only in CacheDescriptor, but also in CacheListDescriptor and ObservableDeferred. |
[alternatively, let's just fix the bug in push_bulk_rules and move on.] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs more thought as above
I'll have a bit more of a think about this when the async/await stuff comes to a head. |
No description provided.