Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-98051

_getDataAsyncCommon may not run continuation on executor thread

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            erin.mcnulty@mongodb.com Erin McNulty
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: