• Seth Hoenig's avatar
    client: fix race condition in use of go-getter · 6445da9b
    Seth Hoenig authored
    go-getter creates a circular dependency between a Client and Getter,
    which means each is inherently thread-unsafe if you try to re-use
    on or the other.
    
    This PR fixes Nomad to no longer make use of the default Getter objects
    provided by the go-getter package. Nomad must create a new Client object
    on every artifact download, as the Client object controls the Src and Dst
    among other things. When Caling Client.Get, the Getter modifies its own
    Client reference, creating the circular reference and race condition.
    
    We can still achieve most of the desired connection caching behavior by
    re-using a shared HTTP client with transport pooling enabled.
    6445da9b