diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-22 16:51:52 +0000 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-22 16:51:52 +0000 |
commit | e8214cb1807d3145907c7ed9e077fa45ada4aeea (patch) | |
tree | 00192416f1c2d2157988a1c07df4601475a30a73 /src/membership.rs | |
parent | c0335ac6904598b9ac367e17651da477d4d970d7 (diff) | |
download | garage-e8214cb1807d3145907c7ed9e077fa45ada4aeea.tar.gz garage-e8214cb1807d3145907c7ed9e077fa45ada4aeea.zip |
Better concurrency:
Use Notify instead of stupid sleep in background worker
Use Semaphore to limit concurrent requests in rpc_client
Make more background tasks cancellable
Diffstat (limited to 'src/membership.rs')
-rw-r--r-- | src/membership.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/membership.rs b/src/membership.rs index 78c1dbe3..f9ffa3b4 100644 --- a/src/membership.rs +++ b/src/membership.rs @@ -296,8 +296,10 @@ impl System { ring.rebuild_ring(); let (update_ring, ring) = watch::channel(Arc::new(ring)); - let rpc_http_client = - Arc::new(RpcHttpClient::new(&config.rpc_tls).expect("Could not create RPC client")); + let rpc_http_client = Arc::new( + RpcHttpClient::new(config.max_concurrent_requests, &config.rpc_tls) + .expect("Could not create RPC client"), + ); let rpc_path = MEMBERSHIP_RPC_PATH.to_string(); let rpc_client = RpcClient::new( |