Skip to content

Commit

Permalink
fix(i): Fetcher wrapper panic (#3400)
Browse files Browse the repository at this point in the history
## Relevant issue(s)

Resolves #3399

## Description

This PR fixes an issue where the `Start` function of `wrappingFetcher`
would not return an error causing a seg fault when trying to access the
fetcher in a subsequent `FetchNext` call.

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

No added tests. I'm unsure if this is worth testing with mocks, but open
to suggestions.

Specify the platform(s) on which this was tested:
- MacOS
  • Loading branch information
nasdf authored Jan 20, 2025
1 parent f24fda4 commit 486f9da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/db/fetcher/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ func (f *wrappingFetcher) Start(ctx context.Context, prefixes ...keys.Walkable)
var top fetcher
top, err = newPrefixFetcher(ctx, f.txn, dsPrefixes, f.col, fieldsByID, client.Active, &execInfo)
if err != nil {
return nil
return err
}

if f.showDeleted {
deletedFetcher, err := newPrefixFetcher(ctx, f.txn, dsPrefixes, f.col, fieldsByID, client.Deleted, &execInfo)
if err != nil {
return nil
return err
}

top = newMultiFetcher(top, deletedFetcher)
Expand Down

0 comments on commit 486f9da

Please sign in to comment.