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

Fixed and Arbitrary executors names can lead to confusion

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch
    • Service Arch Prioritized List

      In SERVER-89893 we discovered that we mistakenly used the arbitrary executor for an operation that could potentially block. In order to fix it we had to change it to the fixed executor.

      This exposed a problem of executors understanding that could grow to deadlock the server if used in more critical places.

      The situation right now is that the following is what's happening today on sharding:

      • Blocking operations should use the fixed executor
      • Non-blocking operations should use the arbitrary executor

      Additionally, the situation is asymmetrical depending on the deployment:

      Sharded clusters

      Replica sets

      This is a dangerous situation as if we were to perform ANY blocking work on a sharded arbitrary executor we risk deadlocking the server since there is a fixed amount of threads processing the event loop.

      All of this though stems from the naming conventions used here. At this point the decision of whether to use a fixed or an arbitrary executor depends on whether the developer knows what the underlying executors actually are. Ideally we should rename them to be what their intended use is, namely "Blocking Executor" or "Non-blocking executor" to be in line with thread pool best practices. This would prevent future problems and help clarify when to use which.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: