Skip to content

bug: Close bolt on error when updating index#2376

Merged
CascadingRadium merged 3 commits into
masterfrom
boltLeak
Jul 9, 2026
Merged

bug: Close bolt on error when updating index#2376
CascadingRadium merged 3 commits into
masterfrom
boltLeak

Conversation

@CascadingRadium

Copy link
Copy Markdown
Member
  • When updating an index with an updated mapping, we open bolt via scorch's OpenMeta API but we never close it on error.
  • The error case can happen if the user has given an invalid mapping or if the updated mapping does not satisfy the criterion required for index update.
  • Scorch's Close() API handles the dual case:
    • If only bolt is opened but not scorch, it closes only bolt.
    • If both bolt and scorch is opened, it closes both.
  • Fix the issue by always closing scorch on error, irrespective of whether it was opened using OpenMeta or Open or OpenMeta + Open.

@coveralls

coveralls commented Jul 9, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 52.339% (-0.01%) from 52.351% — boltLeak into master

Comment thread index_impl.go
Comment thread index_impl.go
Comment thread index_impl.go
@CascadingRadium CascadingRadium merged commit 5418bb6 into master Jul 9, 2026
10 checks passed
@CascadingRadium CascadingRadium deleted the boltLeak branch July 9, 2026 08:19
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.

4 participants