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. 09 Sep, 2022 1 commit
    • Michael Schurter's avatar
      client: fix data races in config handling (#14139) · c86a3bb8
      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!"
      c86a3bb8
  2. 15 Mar, 2022 1 commit
    • James Rasell's avatar
      client: refactor common service registration objects from Consul. · 6e8f32a2
      James Rasell authored
      This commit performs refactoring to pull out common service
      registration objects into a new `client/serviceregistration`
      package. This new package will form the base point for all
      client specific service registration functionality.
      
      The Consul specific implementation is not moved as it also
      includes non-service registration implementations; this reduces
      the blast radius of the changes as well.
      6e8f32a2
  3. 31 Mar, 2021 1 commit
    • Tim Gross's avatar
      test infrastructure for mock client RPCs (#10193) · bb194cb9
      Tim Gross authored
      This commit includes a new test client that allows overriding the RPC
      protocols. Only the RPCs that are passed in are registered, which lets you
      implement a mock RPC in the server tests. This commit includes an example of
      this for the ClientCSI RPC server.
      bb194cb9
  4. 13 Oct, 2020 1 commit
    • Seth Hoenig's avatar
      consul/connect: dynamically select envoy sidecar at runtime · bdeb73cd
      Seth Hoenig authored
      As newer versions of Consul are released, the minimum version of Envoy
      it supports as a sidecar proxy also gets bumped. Starting with the upcoming
      Consul v1.9.X series, Envoy v1.11.X will no longer be supported. Current
      versions of Nomad hardcode a version of Envoy v1.11.2 to be used as the
      default implementation of Connect sidecar proxy.
      
      This PR introduces a change such that each Nomad Client will query its
      local Consul for a list of Envoy proxies that it supports (https://github.com/hashicorp/consul/pull/8545)
      and then launch the Connect sidecar proxy task using the latest supported version
      of Envoy. If the `SupportedProxies` API component is not available from
      Consul, Nomad will fallback to the old version of Envoy supported by old
      versions of Consul.
      
      Setting the meta configuration option `meta.connect.sidecar_image` or
      setting the `connect.sidecar_task` stanza will take precedence as is
      the current behavior for sidecar proxies.
      
      Setting the...
      bdeb73cd
  5. 23 Jan, 2019 1 commit
  6. 22 Jan, 2019 3 commits
  7. 12 Jan, 2019 2 commits
  8. 20 Dec, 2018 1 commit
  9. 16 Dec, 2018 1 commit
  10. 15 Dec, 2018 1 commit
    • Mahmood Ali's avatar
      tests: avoid implicitly asserting clean shutdown · 29ef7ecf
      Mahmood Ali authored
      The assertion here is causing many spurious failures that aren't
      actually relevant to the test itself.
      
      We are tracking the cause for this failure independently, and it would
      make more sense to have a dedicated test for clean shutdown.
      29ef7ecf
  11. 11 Dec, 2018 2 commits
  12. 17 Oct, 2018 1 commit
  13. 16 Oct, 2018 5 commits
  14. 13 Sep, 2018 1 commit
  15. 12 Jun, 2018 1 commit
  16. 21 Mar, 2018 1 commit
  17. 15 Feb, 2018 2 commits