Skip to content

Commit

Permalink
remove vpn api use from agent for time being (#2800)
Browse files Browse the repository at this point in the history
* remove vpn api use from agent for time being

* ..

* ..
  • Loading branch information
aviramha authored Oct 7, 2024
1 parent c20f448 commit 2aae35f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog.d/2794.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't drop RSTs, makes long-lived connections drop on steal start
17 changes: 7 additions & 10 deletions mirrord/agent/src/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ use crate::{
StealerCommand, TcpConnectionStealer, TcpStealerApi,
},
util::{run_thread_in_namespace, ClientId},
vpn::VpnApi,
watched_task::{TaskStatus, WatchedTask},
*,
};
Expand Down Expand Up @@ -201,7 +200,6 @@ struct ClientConnectionHandler {
tcp_outgoing_api: TcpOutgoingApi,
udp_outgoing_api: UdpOutgoingApi,
dns_api: DnsApi,
vpn_api: VpnApi,
state: State,
/// Whether the client has sent us [`ClientMessage::ReadyForLogs`].
ready_for_logs: bool,
Expand All @@ -226,7 +224,6 @@ impl ClientConnectionHandler {

let tcp_outgoing_api = TcpOutgoingApi::new(pid);
let udp_outgoing_api = UdpOutgoingApi::new(pid);
let vpn_api = VpnApi::new(pid);

let client_handler = Self {
id,
Expand All @@ -237,7 +234,6 @@ impl ClientConnectionHandler {
tcp_outgoing_api,
udp_outgoing_api,
dns_api,
vpn_api,
state,
ready_for_logs: false,
};
Expand Down Expand Up @@ -376,10 +372,10 @@ impl ClientConnectionHandler {
Ok(message) => self.respond(DaemonMessage::GetAddrInfoResponse(message)).await?,
Err(e) => break e,
},
message = self.vpn_api.daemon_message() => match message{
Ok(message) => self.respond(DaemonMessage::Vpn(message)).await?,
Err(e) => break e,
},
// message = self.vpn_api.daemon_message() => match message{
// Ok(message) => self.respond(DaemonMessage::Vpn(message)).await?,
// Err(e) => break e,
// },
_ = cancellation_token.cancelled() => return Ok(()),
}
};
Expand Down Expand Up @@ -481,8 +477,9 @@ impl ClientConnectionHandler {
ClientMessage::ReadyForLogs => {
self.ready_for_logs = true;
}
ClientMessage::Vpn(message) => {
self.vpn_api.layer_message(message).await?;
ClientMessage::Vpn(_message) => {
unreachable!("VPN is not supported");
// self.vpn_api.layer_message(message).await?;
}
}

Expand Down
1 change: 1 addition & 0 deletions mirrord/agent/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub(crate) enum AgentError {
#[error("Timeout on accepting first client connection")]
FirstConnectionTimeout,

#[allow(dead_code)]
/// Temporary error for vpn feature
#[error("Generic error in vpn: {0}")]
VpnError(String),
Expand Down
1 change: 1 addition & 0 deletions mirrord/agent/src/vpn.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
use std::{
fmt,
io::Read,
Expand Down

0 comments on commit 2aae35f

Please sign in to comment.