Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! Fixes #19675: Restart HTTP clients…
Browse files Browse the repository at this point in the history
… when configuration changes

Fixes #19675: Restart HTTP clients when configuration changes
  • Loading branch information
amousset committed Aug 9, 2021
1 parent 74de67a commit 8ec3fa8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions relay/sources/relayd/src/lib.rs
Expand Up @@ -342,6 +342,8 @@ impl JobConfig {
// will continue normally with previous configuration in the old client.
// * when all requests in the old client are over, all references to the `Arc` will disappear
// and the old client itself will be dropped.
// * the unchanged downstream clients will be kept thanks to the reference to the old client
// added to the new `HashMap`.
//
// To enable this replacement, we store the clients in a `RwLock`. Write locking will be
// possible as when using the clients to make requests, we don't lock for the request
Expand Down Expand Up @@ -400,6 +402,7 @@ impl JobConfig {
// this will drop the previous `HashMap` and free the references to the clients that it
// contained. The only references left are clients with ongoing requests, which will all be
// dropped when they are over.
// It would also be possible to modify the current `HashMap in place` for slightly better performance.
*downstream_clients = new_downstream_clients;
}

Expand Down

0 comments on commit 8ec3fa8

Please sign in to comment.