mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
chore(connlib): improve logging on missing flow (#7508)
Normally, there always be exactly on pending flow per resource. It appears though that it can sometimes happen that we first request a flow for a resource but by the time it is authorised, we've already cleared its local state. Regardless, this isn't a concerning error and not worth logging on WARN (which happens one layer up).
This commit is contained in:
@@ -685,7 +685,7 @@ impl ClientState {
|
||||
self.drain_node_events();
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip_all, fields(%gateway_id))]
|
||||
#[tracing::instrument(level = "debug", skip_all, fields(%resource_id))]
|
||||
#[expect(clippy::too_many_arguments)]
|
||||
pub fn handle_flow_created(
|
||||
&mut self,
|
||||
@@ -698,18 +698,18 @@ impl ClientState {
|
||||
gateway_ice: IceCredentials,
|
||||
now: Instant,
|
||||
) -> anyhow::Result<Result<(), NoTurnServers>> {
|
||||
tracing::trace!("Updating resource routing table");
|
||||
tracing::debug!(%gateway_id, "New flow authorized for resource");
|
||||
|
||||
let resource = self
|
||||
.resources_by_id
|
||||
.get(&resource_id)
|
||||
.context("Unknown resource")?;
|
||||
|
||||
let buffered_packets = self
|
||||
.pending_flows
|
||||
.remove(&resource_id)
|
||||
.context("No pending flow for resource")?
|
||||
.packets;
|
||||
let Some(pending_flow) = self.pending_flows.remove(&resource_id) else {
|
||||
tracing::debug!("No pending flow");
|
||||
|
||||
return Ok(Ok(()));
|
||||
};
|
||||
|
||||
if let Some(old_gateway_id) = self.resources_gateways.insert(resource_id, gateway_id) {
|
||||
if self.peers.get(&old_gateway_id).is_some() {
|
||||
@@ -742,6 +742,8 @@ impl ClientState {
|
||||
self.peers.insert(GatewayOnClient::new(gateway_id), &[]);
|
||||
};
|
||||
|
||||
let buffered_packets = pending_flow.packets;
|
||||
|
||||
match resource {
|
||||
Resource::Cidr(_) | Resource::Internet(_) => {
|
||||
self.peers.add_ips_with_resource(
|
||||
|
||||
Reference in New Issue
Block a user