Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-3445

Move timeout logic to OpMsg subclasses

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Ruby Drivers

      One of the challenges with the cursor work is that both the find and getMore commands have non-standard behaviors regarding timeouts. Currently, the maxTimeMS option is being set identically for every command, on the Protocol::Message class. In order to support per-command timeout behaviors, we need to move that to the OpMsg subclasses themselves.

      Generally, this can be done with minimal hassle:

      • Pass context to a new OpMsg by adding a parameter to Specifiable#initialize. (We need to be careful because Specifiable is also used on Operation classes; we might need a separate constructor for OpMsg subclasses). The OpMsgExecutable#execute methods are already being given the context, so it shouldn’t be hard to pass it through.
      • Modify OpMsgBase#message so that it uses the context to apply the default timeout behavior to the command.

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            jamis.buck@mongodb.com Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: