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

allow setting a Status on TaskExecutor::EventState

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Networking, Sharding
    • None
    • Sharding

    Description

      Rationale:

      To make Events more useful (and more akin to regular event programming), they should be able to report the status of the Event they were tracking.

      Possible implementation:

      • Add a Status field to TaskExecutor::EventState
      • Add a TaskExecutor::setEventStatus(const EventHandle& event, Status status) method (that takes the same lock as TaskExecutor::waitForEvent) to set the EventState's status
      • Make TaskExecutor::waitForEvent(const EventHandle& event) return the eventState's Status:

      void ThreadPoolTaskExecutor::waitForEvent(const EventHandle& event) {
          invariant(event.isValid());
          auto eventState = checked_cast<EventState*>(getEventFromHandle(event));
          stdx::unique_lock<stdx::mutex> lk(_mutex);
          while (!eventState->isSignaledFlag) {
              eventState->isSignaledCondition.wait(lk);
          }
      +    return eventState->status
      }
      

      Attachments

        Activity

          People

            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: