Skip to content

Conversation

@Xuyuchao-juice
Copy link
Contributor

close #6640

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

Fixes a nil-pointer panic in dbMeta.doBatchUnlink for SQL metadata backends by safely handling missing entries in the delNodes map (issue #6640).

Changes:

  • Guarded access to delNodes[info.n.Inode] by using a map existence check before reading .opened.

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

entrySpace = align4K(info.n.Length)
needRecordStats = true
if delNodes[info.n.Inode].opened {
if dn, ok := delNodes[info.n.Inode]; ok && dn.opened {
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

Consider adding a regression test that exercises BatchUnlink/doBatchUnlink when m.sid == 0 (e.g., after NewSession(false) or without recording a session). This is the scenario that previously triggered the nil-pointer panic, and a focused test would prevent accidental reintroduction.

Copilot uses AI. Check for mistakes.
@Xuyuchao-juice Xuyuchao-juice marked this pull request as ready for review January 27, 2026 14:30
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.

CI: panic in pkg/meta.(*dbMeta).doBatchUnlink.func1

2 participants