Skip to content

borrow mut panic#17

Merged
ruslanti merged 2 commits intomainfrom
fix/borrow_mut_panic
Feb 23, 2026
Merged

borrow mut panic#17
ruslanti merged 2 commits intomainfrom
fix/borrow_mut_panic

Conversation

@ruslanti
Copy link
Contributor

No description provided.

@ruslanti ruslanti self-assigned this Feb 20, 2026
@ruslanti ruslanti added the bug Something isn't working label Feb 20, 2026
Copy link

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 pull request addresses potential panic issues in the nginx_module by replacing borrow_mut() calls with try_borrow_mut() throughout the unix_socket implementation. This defensive programming approach prevents runtime panics when RefCell borrows fail due to re-entrant calls or concurrent access patterns in the nginx event loop.

Changes:

  • Introduced log_borrow_mut_error helper function to standardize error logging for borrow failures
  • Replaced all borrow_mut() calls with try_borrow_mut() in critical paths (connect, disconnected, stop, write, on_read, on_reconnect_timeout)
  • Version bumped from 0.1.5 to 0.1.6

Reviewed changes

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

File Description
nginx_module/src/unix_socket.rs Systematic conversion of borrow_mut() to try_borrow_mut() with error handling; added log_borrow_mut_error helper function for consistent error logging across all borrow failure cases
nginx_module/Cargo.toml Version bump from 0.1.5 to 0.1.6 to reflect the bug fix

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

@ruslanti ruslanti merged commit 63ecb10 into main Feb 23, 2026
5 of 7 checks passed
@ruslanti ruslanti deleted the fix/borrow_mut_panic branch February 23, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants