Skip to content

windows: load mmdb file in memory - #4879

Merged
blotus merged 1 commit into
masterfrom
windows-mmdb-load-in-memory
Dec 4, 2026
Merged

blotus merged 1 commit into
masterfrom
windows-mmdb-load-in-memory

Conversation

@blotus

@blotus blotus commented Dec 4, 2026

Copy link
Copy Markdown
Member

Only on windows, load MMDB files directly in memory instead on mmap()'ing them: when the file is replaced, windows would make all uncached page return 0, which breaks the lookup.

So load the file entirely in memory to avoid this. Because this increases the memory usage by the size of the DBs, we only do it on windows, where the issue occurs.

@blotus blotus added the kind/fix label Dec 4, 2026
@codecov

codecov Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.46154% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.22%. Comparing base (523ecb5) to head (be46c4f).

Files with missing lines Patch % Lines
pkg/exprhelpers/geoip_open_windows.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4879      +/-   ##
==========================================
- Coverage   72.26%   72.22%   -0.04%     
==========================================
  Files         549      551       +2     
  Lines       37615    37625      +10     
==========================================
- Hits        27182    27176       -6     
- Misses      10432    10448      +16     
  Partials        1        1              
Flag Coverage Δ
bats 45.02% <100.00%> (+<0.01%) ⬆️
unit-linux 50.72% <100.00%> (-0.01%) ⬇️
unit-windows 39.07% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sabban sabban left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@blotus
blotus merged commit 8a7a177 into master Dec 4, 2026
15 checks passed
@blotus
blotus deleted the windows-mmdb-load-in-memory branch December 4, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants