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

Decouple AdmissionContext from execution control

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • Service Arch 2024-03-18, Service Arch 2024-04-01

      The AdmissionContext class is currently a decoration on OperationContext that serves three purposes:

      • It holds the priority the operation should have upon admission.
      • It keeps track of the instant when the operation was last admitted (i.e. startProcessingTime).
        • This is used to track the duration of processing (i.e. the time during which the admission ticket was held).
      • It keeps track of how many times the operation went through admission.
        • This is used to keep track of how many different operations went through the admission mechanism (i.e. the totalNewAdmissions metric).

      There are several problems with this approach:

      • Sharing the same AdmissionContext across different admission mechanisms means that the metrics for it will be calculated incorrectly.
      • Using the startProcessingTime value to calculate the duration of processing does not take reentrancy into account.
      • Not all future admission control mechanisms will necessarily tie their admission metrics to the OperationContext.

      To solve this, we should:

      • move the startProcessingTime inside the ticket
      • make a decoration derived from AdmissionContext for each admission control mechanism that needs it

            Assignee:
            vojislav.stojkovic@mongodb.com Vojislav Stojkovic
            Reporter:
            vojislav.stojkovic@mongodb.com Vojislav Stojkovic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: