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. 24 Aug, 2022 7 commits
  2. 23 Aug, 2022 8 commits
  3. 22 Aug, 2022 14 commits
  4. 19 Aug, 2022 3 commits
  5. 18 Aug, 2022 8 commits
    • Michael Schurter's avatar
      client: fix data races in config handling (#14139) · 01648e61
      Michael Schurter authored
      Before this change, Client had 2 copies of the config object: config and configCopy. There was no guidance around which to use where (other than configCopy's comment to pass it to alloc runners), both are shared among goroutines and mutated in data racy ways. At least at one point I think the idea was to have `config` be mutable and then grab a lock to overwrite `configCopy`'s pointer atomically. This would have allowed alloc runners to read their config copies in data race safe ways, but this isn't how the current implementation worked.
      
      This change takes the following approach to safely handling configs in the client:
      
      1. `Client.config` is the only copy of the config and all access must go through the `Client.configLock` mutex
      2. Since the mutex *only protects the config pointer itself and not fields inside the Config struct:* all config mutation must be done on a *copy* of the config, and then Client's config pointer is overwritten while the mutex is acquired. Alloc runners and other goroutines with the old config pointer will not see config updates.
      3. Deep copying is implemented on the Config struct to satisfy the previous approach. The TLS Keyloader is an exception because it has its own internal locking to support mutating in place. An unfortunate complication but one I couldn't find a way to untangle in a timely fashion.
      4. To facilitate deep copying I made an *internally backward incompatible API change:* our `helper/funcs` used to turn containers (slices and maps) with 0 elements into nils. This probably saves a few memory allocations but makes it very easy to cause panics. Since my new config handling approach uses more copying, it became very difficult to ensure all code that used containers on configs could handle nils properly. Since this code has caused panics in the past, I fixed it: nil containers are copied as nil, but 0-element containers properly return a new 0-element container. No more "downgrading to nil!"
      Unverified
      01648e61
    • Derek Strickland's avatar
      sentinel: add support for Nomad ACL Token and Namespace (#14171) · a67bdd14
      Derek Strickland authored
      * sentinel: add ability to reference Nomad ACL Token and Namespace in Sentinel policies
      Unverified
      a67bdd14
    • Michael Schurter's avatar
    • Seth Hoenig's avatar
      Merge pull request #14187 from hashicorp/f-print-correct-go-version-windows-circle · c5f5ba79
      Seth Hoenig authored
      build: print installed go version in cricle on windows
      Unverified
      c5f5ba79
    • Seth Hoenig's avatar
      build: print installed go version in cricle on windows · c3d024e7
      Seth Hoenig authored
      This PR fixes the circle workflow step on windows where we print
      the go version. Like the other commands that use Go, we must
      inject the install path into PATH first.
      c3d024e7
    • Seth Hoenig's avatar
      Merge pull request #14181 from hashicorp/cleanup-command-tests-part-2 · f125f9bb
      Seth Hoenig authored
      cleanup: fixing warnings and refactoring of command package, part 2
      Unverified
      f125f9bb
    • Seth Hoenig's avatar
      cleanup: fixing warnings and refactoring of command package, part 2 · 9cc27b3c
      Seth Hoenig authored
      This PR continues the cleanup of the command package, removing linter
      warnings, refactoring to use helpers, making tests easier to read, etc.
      9cc27b3c
    • Seth Hoenig's avatar
      Merge pull request #14172 from hashicorp/cleanup-command-tests-wait-for-node · 6ca539a2
      Seth Hoenig authored
      cleanup: first pass at fixing command package warnings
      Unverified
      6ca539a2