_withValueIn() results eventually show QL.timeout error
Summary: The problem is pretty clear: we are caching an InvocationValue, which makes sense in principle, but in practice that InvocationValue includes its start time, which eventually causes a timeout.
Specifically, the problem is in Invocation.flatMap()
, which does this bit:
val timeProvider = ecology.api[querki.time.TimeProvider]
if (timeProvider.now.getMillis > inv.context.endTime.getMillis) {
Future.failed(PublicException("QL.timeout"))
} else ...
Sadly, the implication is that _withValueIn() needs improvement. The heart of the problem is that caching an InvocationValue
like this is corrupt -- we can't do that. We're going to have to come up with a cleverer way to do this, such that we cache something more appropriate. (Probably a Future
, I suspect.)