remove termination case from PluginConnection
@@ -6,7 +6,6 @@ use crate::device_plugin_api::v1beta1::{
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use tokio::sync::broadcast;
-use tokio::sync::Mutex as AsyncMutex;
use tonic::Request;
use tracing::{error, trace};
@@ -18,8 +17,6 @@ pub struct PluginConnection {
client: DevicePluginClient<tonic::transport::Channel>,
/// `RegisterRequest` received when the device plugin registered with the DeviceRegistry
register_request: RegisterRequest,
- /// Boolean for signaling that the ListAndWatch connection with the channel should be closed
- stop_connection: Arc<AsyncMutex<bool>>,
}
impl PluginConnection {
@@ -30,7 +27,6 @@ impl PluginConnection {
PluginConnection {
client,
register_request,
- stop_connection: Arc::new(AsyncMutex::new(false)),
}
}
@@ -52,10 +48,6 @@ impl PluginConnection {
}
}
- pub async fn stop(&self) {
- *self.stop_connection.lock().await = true;
- }
-
/// Connects to a device plugin's ListAndWatch service.
/// The device plugin updates this client periodically about changes in the capacity and health of its resource.
/// Upon updates, this propagates any changes into the `plugins` map and triggers the `NodePatcher` to
@@ -83,9 +75,6 @@ impl PluginConnection {
// TODO handle error -- maybe channel is full
update_node_status_sender.send(()).unwrap();
}
- if *self.stop_connection.lock().await {
- break;
- }
}
Ok(())
