Skip to content

Conversation

@sanity
Copy link
Collaborator

@sanity sanity commented Nov 1, 2025

Summary

  • guard transaction timeout notifications so shutdown can drop the receiver without panicking
  • add unit coverage for notification delivery and dropped receiver cases

Testing

  • cargo test notify_timeout
  • cargo test --test connectivity test_three_node_network_connectivity -- --nocapture
  • cargo clippy --all-targets --all-features

Fixes #2042

@sanity sanity requested review from Copilot and iduartgomez November 1, 2025 01:23

This comment was marked as outdated.

@sanity sanity force-pushed the issue-2042-op-state-shutdown branch from 85bd9dd to 836b8fe Compare November 1, 2025 01:26
@sanity sanity requested a review from Copilot November 1, 2025 01:27
Copy link
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if removed {
tracing::debug!("Transaction timed out: {tx}");
event_loop_notifier.notifications_sender.send(Either::Right(NodeEvent::TransactionTimedOut(tx))).await.unwrap();
notify_transaction_timeout(&event_loop_notifier, tx).await;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@claude change this to warn indtead

Copy link

@claude claude bot Nov 1, 2025

Choose a reason for hiding this comment

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

Claude finished @iduartgomez's task —— View job


Change Complete

  • Read the file to identify line 429
  • Change log level to warn
  • Commit and push changes

Changed the log level from debug to warn in the notify_transaction_timeout function at line 345. This warning now properly alerts when the event loop receiver has been dropped during shutdown.

Changes:

  • crates/core/src/node/op_state_manager.rs:345 - Changed tracing::debug! to tracing::warn!

View commit |

Copy link
Collaborator

Choose a reason for hiding this comment

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

@claude check if is an error while sending and log a warn

Copy link

@claude claude bot Nov 1, 2025

Choose a reason for hiding this comment

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

Claude finished @iduartgomez's task —— View job


Analysis Complete

  • Read the current code to understand the send operation
  • Analyze error handling implementation

Current Implementation:

The notify_transaction_timeout function (crates/core/src/node/op_state_manager.rs:334-353) already implements error checking and warning logging:

match event_loop_notifier
    .notifications_sender
    .send(Either::Right(NodeEvent::TransactionTimedOut(tx)))
    .await
{
    Ok(()) => true,
    Err(err) => {
        tracing::warn!(
            tx = %tx,
            error = ?err,
            "Failed to notify event loop about timed out transaction; receiver likely dropped"
        );
        false
    }
}

The function returns a bool (true on success, false on error) and logs a warning when the send fails.

Call Sites:

The function is called at two locations (lines 400 and 429) without using the return value:

  • Line 400: notify_transaction_timeout(&event_loop_notifier, tx).await;
  • Line 429: notify_transaction_timeout(&event_loop_notifier, tx).await;

Question:

The error checking and warning are already implemented inside the function. Would you like me to:

  1. Keep it as-is (the function already logs warnings on send errors)
  2. Make the call sites explicitly check the return value and add additional logging
  3. Something else?

Please clarify what specific change you'd like made.

Co-authored-by: nacho.d.g <iduartgomez@users.noreply.github.com>
@iduartgomez iduartgomez added this pull request to the merge queue Nov 1, 2025
Merged via the queue into main with commit a283e23 Nov 1, 2025
12 checks passed
@iduartgomez iduartgomez deleted the issue-2042-op-state-shutdown branch November 1, 2025 05:48
iduartgomez pushed a commit that referenced this pull request Nov 4, 2025
- Analyzed test_small_network_get_failure failure modes
- Identified gateway crash root cause (fixed in a283e23)
- Documented PUT operation timeout issues
- Provided recommendations for re-enabling the test
- Suggested modernization using #[freenet_test] macro

Related: #2023, #2043, #2036, #2011
iduartgomez pushed a commit that referenced this pull request Nov 4, 2025
- Analyzed test_small_network_get_failure failure modes
- Identified gateway crash root cause (fixed in a283e23)
- Documented PUT operation timeout issues
- Provided recommendations for re-enabling the test
- Suggested modernization using #[freenet_test] macro

Related: #2023, #2043, #2036, #2011
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.

Panic in op_state_manager during connectivity test shutdown

3 participants