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

Create a Timeout class for use in the server

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      We currently have no consistent way of passing timeouts around in the server. Some places pass timeouts as Seconds or Milliseconds, some pass timeouts as bare doubles and rely on code comments to state what granularity they express. Some methods use boost::optional to express whether a timeout has been set, and some provide a default value instead, but do this inconsistently (we alternate between using "0" and "-1" to express "no timeout specified"). All these inconsistencies make it very easy to create bugs like SERVER-27358.

      We should implement a Timeout class to uniformly express timeouts in the server. This class should be flexible enough to accept Seconds or Milliseconds. Because we rely on "explicit passed-in value or a default" logic, this class should also express optionality in a sane way.

            Assignee:
            mira.carey@mongodb.com Mira Carey
            Reporter:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: