Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-3910

Libprocess: Implement cleanup of the SocketManager in process::finalize

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.2.0
    • libprocess, test
    • Mesosphere Sprint 40, Mesosphere Sprint 41, Mesosphere Sprint 42
    • 5

    Description

      The socket_manager and process_manager are intricately tied together. Currently, only the process_manager is cleaned up by process::finalize.

      To clean up the socket_manager, we must close all sockets and deallocate any existing HttpProxy or Encoder objects. And we should prevent further objects from being created/tracked by the socket_manager.

      Proposal

      1. Clean up all processes other than gc. This will clear all links and delete all HttpProxy s while socket_manager still exists.
      2. Close all sockets via SocketManager::close. All of socket_manager 's state is cleaned up via SocketManager::close, including termination of HttpProxy (termination is idempotent, meaning that killing HttpProxy s via process_manager is safe).
      3. At this point, socket_manager should be empty and only the gc process should be running. (Since we're finalizing, assume there are no threads trying to spawn processes.) socket_manager can be deleted.
      4. gc can be deleted. This is currently a leaked pointer, so we'll also need to track and delete that.
      5. process_manager should be devoid of processes, so we can proceed with cleanup (join threads, stop the EventLoop, etc).

      Attachments

        Issue Links

          Activity

            People

              kaysoky Joseph Wu
              kaysoky Joseph Wu
              Joris Van Remoortere Joris Van Remoortere
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: