Fix logging of ADNL key activation on QUIC server#121
Open
cleverfox wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts QUIC key activation behavior to avoid logging “Activated” when the activation doesn’t actually change the server’s SNI fallback identity.
Changes:
- Track whether
last_added_nameactually changes duringactivate_key_inner. - Emit the “Activated QUIC identity …” info log only when the fallback identity is updated.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+850
to
+858
| let changed = if let Ok(mut last) = endpoint_state.last_added_name.lock() { | ||
| if last.as_deref() == Some(name.as_str()) { | ||
| false | ||
| } else { | ||
| *last = Some(name); | ||
| true | ||
| } | ||
| } else { | ||
| false |
There was a problem hiding this comment.
If endpoint_state.last_added_name mutex is poisoned, changed becomes false and the activation request is silently ignored (and no log is emitted). Consider logging a warn/error in the Err(_) branch, and optionally recovering via PoisonError::into_inner() so the fallback identity can still be updated after a panic.
Suggested change
| let changed = if let Ok(mut last) = endpoint_state.last_added_name.lock() { | |
| if last.as_deref() == Some(name.as_str()) { | |
| false | |
| } else { | |
| *last = Some(name); | |
| true | |
| } | |
| } else { | |
| false | |
| let changed = match endpoint_state.last_added_name.lock() { | |
| Ok(mut last) => { | |
| if last.as_deref() == Some(name.as_str()) { | |
| false | |
| } else { | |
| *last = Some(name); | |
| true | |
| } | |
| } | |
| Err(poisoned) => { | |
| log::warn!( | |
| target: TARGET, | |
| "activate_key: last_added_name lock poisoned for key {} on port {}, recovering", | |
| key_id, | |
| port | |
| ); | |
| let mut last = poisoned.into_inner(); | |
| if last.as_deref() == Some(name.as_str()) { | |
| false | |
| } else { | |
| *last = Some(name); | |
| true | |
| } | |
| } |
bvscd
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.