Page MenuHomePhabricator

D5012.id16444.diff
No OneTemporary

D5012.id16444.diff

diff --git a/services/backup/blob_client/src/put_client.rs b/services/backup/blob_client/src/put_client.rs
--- a/services/backup/blob_client/src/put_client.rs
+++ b/services/backup/blob_client/src/put_client.rs
@@ -243,5 +243,31 @@
}
pub fn put_client_terminate_cxx() -> Result<(), String> {
- unimplemented!();
+ check_error()?;
+ if !is_initialized() {
+ check_error()?;
+ return Ok(());
+ }
+
+ if let Ok(mut maybe_client) = CLIENT.lock() {
+ if let Some(client) = (*maybe_client).take() {
+ drop(client.tx);
+ RUNTIME.block_on(async {
+ if client.rx_handle.await.is_err() {
+ report_error("wait for receiver handle failed".to_string());
+ }
+ });
+ } else {
+ return Err("no client detected".to_string());
+ }
+ } else {
+ return Err("couldn't access client".to_string());
+ }
+
+ assert!(
+ !is_initialized(),
+ "client transmitter handler released properly"
+ );
+ check_error()?;
+ Ok(())
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 8:09 AM (20 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2519616
Default Alt Text
D5012.id16444.diff (982 B)

Event Timeline