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

fix: Add Logger to constructor function to ensure log field is initialized #19886

Merged
merged 3 commits into from
Nov 3, 2020

Conversation

stuartcarnie
Copy link
Contributor

@stuartcarnie stuartcarnie commented Nov 2, 2020

Closes #19876

Ensure the log field is initialized at construction of the BucketService to avoid panics.

@stuartcarnie stuartcarnie added the area/2.x OSS 2.0 related issues and PRs label Nov 2, 2020
@stuartcarnie stuartcarnie self-assigned this Nov 2, 2020
@stuartcarnie stuartcarnie changed the title fix: Add Logger to constructor function to ensure it is initialized fix: Add Logger to constructor function to ensure log field is initialized Nov 2, 2020
Copy link
Contributor

@danxmoran danxmoran left a comment

Choose a reason for hiding this comment

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

One question but LGTM!

@@ -64,7 +64,7 @@ func TestAnalyticalStore(t *testing.T) {
svcStack = backend.NewAnalyticalRunStorage(logger, svc, ts.BucketService, svc, rr, ab.QueryService())
)

ts.BucketService = storage.NewBucketService(ts.BucketService, ab.storageEngine)
ts.BucketService = storage.NewBucketService(nil, ts.BucketService, ab.storageEngine)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any concerns that this nil might blow up on us later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely – pushed a fix and thanks for finding it. My IDE hid that reference from me :)

@stuartcarnie stuartcarnie merged commit 9b78357 into master Nov 3, 2020
@stuartcarnie stuartcarnie deleted the sgc/issues/19876 branch November 3, 2020 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/2.x OSS 2.0 related issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2.0-rc.3 When trying to create a Bucket : runtime error: invalid memory address or nil pointer dereference
2 participants