This project is mirrored from https://gitee.com/mirrors/nomad.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
  1. 11 Oct, 2018 6 commits
  2. 10 Oct, 2018 2 commits
  3. 06 Oct, 2018 2 commits
  4. 05 Oct, 2018 2 commits
  5. 04 Oct, 2018 6 commits
  6. 03 Oct, 2018 2 commits
  7. 02 Oct, 2018 2 commits
  8. 30 Sep, 2018 3 commits
  9. 28 Sep, 2018 15 commits
    • Michael Schurter's avatar
      372a493d
    • Michael Schurter's avatar
      tr: properly comment handle fields · 1f467c19
      Michael Schurter authored
      1f467c19
    • Michael Schurter's avatar
      ar: AllocState should not mutate ar.state · 0080f5ec
      Michael Schurter authored
      If ar.state.TaskStates has not been set, set it on the copy of ar.state.
      That keeps ar.state manipulations in one location and allows AllocState
      to only acquire read-locks.
      0080f5ec
    • Michael Schurter's avatar
      tests: test logs endpoint against pending task · cbff8c5b
      Michael Schurter authored
      Although the really exciting change is making WaitForRunning return the
      allocations that it started. This should cut down test boilerplate
      significantly.
      cbff8c5b
    • Michael Schurter's avatar
      tests: make a test client/config easier to generate · 8ebda8e8
      Michael Schurter authored
      Sadly can't move the fingerprint timeout tweak into the helper due to
      circular imports.
      8ebda8e8
    • Michael Schurter's avatar
      tests: ensure task state is initialized in NewAR · e342c94f
      Michael Schurter authored
      Also expose NoopDB for use in tests.
      e342c94f
    • Michael Schurter's avatar
      1dbb35dc
    • Michael Schurter's avatar
      client: expose task state to client · 64683e91
      Michael Schurter authored
      The interesting decision in this commit was to expose AR's state and not
      a fully materialized Allocation struct. AR.clientAlloc builds an Alloc
      that contains the task state, so I considered simply memoizing and
      exposing that method.
      
      However, that would lead to AR having two awkwardly similar methods:
       - Alloc() - which returns the server-sent alloc
       - ClientAlloc() - which returns the fully materialized client alloc
      
      Since ClientAlloc() could be memoized it would be just as cheap to call
      as Alloc(), so why not replace Alloc() entirely?
      
      Replacing Alloc() entirely would require Update() to immediately
      materialize the task states on server-sent Allocs as there may have been
      local task state changes since the server received an Alloc update.
      
      This quickly becomes difficult to reason about: should Update hooks use
      the TaskStates? Are state changes caused by TR Update hooks immediately
      reflected in the Alloc? Should AR persist its copy of the Alloc? If so,
      are its TaskStates canonical or the TaskStates on TR?
      
      So! Forget that. Let's separate the static Allocation from the dynamic
      AR & TR state!
      
       - AR.Alloc() is for static Allocation access (often for the Job)
       - AR.AllocState() is for the dynamic AR & TR runtime state (deployment
         status, task states, etc).
      
      If code needs to know the status of a task: AllocState()
      If code needs to know the names of tasks: Alloc()
      
      It should be very easy for a developer to reason about which method they
      should call and what they can do with the return values.
      64683e91
    • Michael Schurter's avatar
      client: add comment · 4966b1f2
      Michael Schurter authored
      4966b1f2
    • Michael Schurter's avatar
      a9c95bda
    • Michael Schurter's avatar
      a27e3af8
    • Michael Schurter's avatar
      tests: fix races caused by sharing a buffer · 02d6f1e2
      Michael Schurter authored
      httptest.ResponseRecorder exposes a bytes.Buffer which we were reading
      and writing concurrently to test streaming log APIs. This is a race, so
      I wrapped the struct in a lock with some helpers.
      02d6f1e2
    • Michael Schurter's avatar
      tr: fix shutdown/destroy/WaitResult handling · 6708458d
      Michael Schurter authored
      Multiple receivers raced for the WaitResult when killing tasks which
      could lead to a deadlock if the "wrong" receiver won.
      
      Wrap handlers in an ugly little proxy to avoid this. At first I wanted
      to push this into drivers, but the result is tied to the TR's handle
      lifecycle -- not the lifecycle of an alloc or task.
      6708458d
    • Michael Schurter's avatar
      client: do not inspect task state to follow logs · a06c18fb
      Michael Schurter authored
      "Ask forgiveness, not permission."
      
      Instead of peaking at TaskStates (which are no longer updated on the
      AR.Alloc() view of the world) to only read logs for running tasks, just
      try to read the logs and improve the error handling if they don't exist.
      
      This should make log streaming less dependent on AR/TR behavior.
      
      Also fixed a race where the log streamer could exit before reading an
      error. This caused no logs or errors to be displayed sometimes when an
      error occurred.
      a06c18fb
    • Michael Schurter's avatar
      mock_driver: close waitCh after exiting · 79a93d56
      Michael Schurter authored
      mock_driver wasn't behaving like other driver handles.
      79a93d56