-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
I was investigating uses of unsafeToInlineFuture in the code, and found that in _getDataAsyncCommon, it looks like the intention is to run the continuation on an executor thread:
return _cache->acquireAsync(_kSingleton, CacheCausalConsistency::kLatestKnown) .thenRunOn(Grid::get(_service)->getExecutorPool()->getFixedExecutor()) .unsafeToInlineFuture() .tapAll([this](auto status) { shard_registry_stats::blockedOpsGauge.decrement(); }) .share();
However, based on recent discussion (linked in comments), .thenRunOn(...).unsafeToInlineFuture(...) will actually just run the continuation inline, not on the executor provided in thenRunOn.
This might not be a big deal in this function (if so, feel free to close as Won't Fix), but I wanted to raise it as it looks like the intended behavior doesn't match the actual behavior here.