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/rpc_server.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/rpc_server.rs')
-rw-r--r-- | src/rpc_server.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpc_server.rs b/src/rpc_server.rs index 938eb512..51661a66 100644 --- a/src/rpc_server.rs +++ b/src/rpc_server.rs @@ -52,9 +52,10 @@ where Ok(resp) => { let resp_bytes = rmp_to_vec_all_named::<Result<M, String>>(&Ok(resp))?; trace!( - "]RPC:{},ok ({} ms)", + "]RPC:{},ok ({} ms), request: {}", name, - (Instant::now() - begin_time).as_millis() + (Instant::now() - begin_time).as_millis(), + req_str, ); Ok(Response::new(Body::from(resp_bytes))) } @@ -68,7 +69,7 @@ where name, e, (Instant::now() - begin_time).as_millis(), - req_str + req_str, ); Ok(err_response) } |