Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3278042
D5012.id16444.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
982 B
Referenced Files
None
Subscribers
None
D5012.id16444.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5012: [services] Backup - Blob Put Client - Add terminate
Attached
Detach File
Event Timeline
Log In to Comment