Skip to content

Conversation

@garmr-ulfr
Copy link
Collaborator

This pull request adds improved error handling and a safety check to the removalQueue's checkPending method. The main goals are to prevent panics from crashing the process during outbound or endpoint removal, and to avoid attempting to remove outbounds that have already been deleted.

Error handling and safety improvements:

  • Added a defer block with a recover() call to log any panic that occurs during outbound or endpoint removal, preventing the process from crashing.
  • Added a check to ensure an outbound still exists before attempting to remove it, logging a trace message and skipping removal if it has already been deleted.

closes getlantern/engineering/issues/2896

Copilot AI review requested due to automatic review settings December 31, 2025 20:02
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

This PR adds error handling and safety improvements to the removalQueue's checkPending method to prevent crashes and handle cases where outbounds are removed concurrently. The changes include panic recovery to prevent process crashes and a double-check to verify outbound existence before removal.

Key Changes

  • Added panic recovery with defer/recover pattern to catch and log panics during outbound/endpoint removal operations
  • Implemented a double-check mechanism to verify an outbound still exists in the manager before attempting removal

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

@garmr-ulfr garmr-ulfr merged commit d187a54 into main Jan 2, 2026
1 check passed
@garmr-ulfr garmr-ulfr deleted the catch-remove-panic branch January 2, 2026 22:08
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