Skip to content

Commit

Permalink
Fix invalid token issue (#790)
Browse files Browse the repository at this point in the history
When a connection token does not exist, it was previously not being
propagated to listeners (e.g. connections waiting on that route info
response), which caused them to hang.
  • Loading branch information
paulgb authored Jul 22, 2024
1 parent 8c85ce3 commit a340680
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions plane/src/database/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ pub async fn emit_state_change(
Ok(())
}

#[derive(Debug)]
pub enum RouteInfoResult {
NotFound,

Expand All @@ -655,6 +656,7 @@ pub enum RouteInfoResult {
Available(RouteInfo),
}

#[derive(Debug)]
pub struct PartialRouteInfo {
pub backend_id: BackendName,
secret_token: SecretToken,
Expand Down
4 changes: 1 addition & 3 deletions plane/src/proxy/route_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ impl RouteMap {
}

pub fn receive(&self, response: RouteInfoResponse) {
if response.route_info.is_some() {
self.insert(response.token, response.route_info);
}
self.insert(response.token, response.route_info);
}

pub fn remove_backend(&self, backend: &BackendName) {
Expand Down

0 comments on commit a340680

Please sign in to comment.