Skip to content

Fix logging of ADNL key activation on QUIC server#121

Open
cleverfox wants to merge 1 commit into
masterfrom
cf/fix_quic_activation_logging
Open

Fix logging of ADNL key activation on QUIC server#121
cleverfox wants to merge 1 commit into
masterfrom
cf/fix_quic_activation_logging

Conversation

@cleverfox
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 23, 2026 12:37
@cleverfox cleverfox requested a review from bvscd April 23, 2026 12:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_name actually changes during activate_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 thread src/adnl/src/quic/mod.rs
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
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
}
}

Copilot uses AI. Check for mistakes.
@cleverfox cleverfox changed the title Fix logging of activation ADNL key for QUIC server Fix logging of ADNL key activation on QUIC server Apr 23, 2026
Base automatically changed from release/node/v0.5.3 to master April 23, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants