Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent debug logging panic when mapping fails #109

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aeron/util/memmap/memmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func MapExisting(filename string, offset int64, length int) (*File, error) {

logger.Debugf("Mapping existing file: fd: %d, size: %d, offset: %d", f.Fd(), size, offset)
mmap, err := doMap(f, offset, mapSize)
if err != nil {
return nil, err
}
logger.Debugf("Mapped existing file @%v for %d", mmap.mmap, mmap.size)

return mmap, err
Expand All @@ -112,6 +115,9 @@ func NewFile(filename string, offset int64, length int) (*File, error) {
}

mmap, err := doMap(f, offset, length)
if err != nil {
return nil, err
}
logger.Debugf("Mapped a new file @%v for %d", mmap.mmap, mmap.size)

return mmap, err
Expand Down