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 deprecated gRPC naming.Watcher #2015

Closed
zendern opened this issue Jan 21, 2020 · 7 comments · Fixed by #3884
Closed

Fix deprecated gRPC naming.Watcher #2015

zendern opened this issue Jan 21, 2020 · 7 comments · Fixed by #3884

Comments

@zendern
Copy link
Contributor

zendern commented Jan 21, 2020

Found as part of #1912 where we fixed most of the linting issues. The only outstanding item is as follows and has been ignored for now by adding a //nolint:staticcheck

pkg/querier/frontend/worker.go:60:10: SA1019: naming.Watcher is deprecated: please use package resolver.  (staticcheck)
	watcher naming.Watcher

watcher naming.Watcher

This will have ripple effects that will go up into where we define the resolver

resolver, err := naming.NewDNSResolverWithFreq(cfg.DNSLookupDuration)
if err != nil {
return nil, err
}
watcher, err := resolver.Resolve(cfg.Address)
if err != nil {
return nil, err
}
ctx, cancel := context.WithCancel(context.Background())
w := &worker{
cfg: cfg,
log: log,
server: server,
ctx: ctx,
cancel: cancel,
watcher: watcher,
}

There is no direct Watcher class that exists in the resolver package referenced. So the migration is likely a little more in depth than just using resolver.Watcher or something similar.

Reference to that Watcher class
https://godoc.org/google.golang.org/grpc/naming#Watcher

zendern added a commit to zendern/cortex that referenced this issue Feb 24, 2020
We have opened up issue
cortexproject#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>
pracucci pushed a commit that referenced this issue Feb 24, 2020
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
@stale
Copy link

stale bot commented Mar 21, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 21, 2020
@stale stale bot closed this as completed Apr 5, 2020
@pracucci
Copy link
Contributor

This is still valid

@pracucci pracucci reopened this Jul 20, 2020
@stale stale bot removed the stale label Jul 20, 2020
@codesome codesome mentioned this issue Jul 20, 2020
3 tasks
@stale
Copy link

stale bot commented Sep 18, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 18, 2020
@pracucci
Copy link
Contributor

Still valid

@stale stale bot removed the stale label Sep 18, 2020
@pracucci pracucci changed the title Fix deprecation warning Fix deprecated gRPC naming.Watcher Oct 1, 2020
@pracucci
Copy link
Contributor

pracucci commented Oct 1, 2020

This will be required once we'll upgrade gRPC (1.30.0 or above), but we're currently blocked by etcd not supporting it yet. See this issue for more details: etcd-io/etcd#12124.

@stale
Copy link

stale bot commented Nov 30, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 30, 2020
@pracucci
Copy link
Contributor

pracucci commented Dec 1, 2020

Still valid

@stale stale bot removed the stale label Dec 1, 2020
@jtlisi jtlisi mentioned this issue Feb 25, 2021
3 tasks
aknuds1 pushed a commit to grafana/dskit that referenced this issue Aug 28, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 1, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 1, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
treid314 pushed a commit to treid314/dskit that referenced this issue Sep 1, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 2, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 2, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 7, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 7, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 7, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 8, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 8, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 8, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 8, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 8, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 8, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
treid314 pushed a commit to treid314/dskit that referenced this issue Sep 8, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 9, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 9, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 9, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 10, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 10, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Sep 10, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Oct 7, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Oct 7, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Oct 7, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Oct 7, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue Dec 23, 2021
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue May 26, 2023
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue May 26, 2023
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
aknuds1 pushed a commit to grafana/dskit that referenced this issue May 26, 2023
* Cleanup linting errors around deadcode

To be specific ineffassign, deadcode and unused errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Replaced by keysFn and if the config defines it then it will distribute
keys using hashing

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Hold over from when readBatch as also the iterator

Now that we have an iterator there is no need to also have a consumed
bool on the underlying object.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Necessary to fix the false sharing problem

Will never actually be used. Only necessary to pad out CPU cache lines.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Removing unused code

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup all gosimple suggestions

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fixing all errcheck

Attempted not to change any existing logic so if an error was ignored we
will now either explicitly ignore it or in the case of a goroutine being
called with a func that is ignoring the error we will just put a
//noling:errcheck on that line.

If it was in a test case we went ahead and did the extra assertion
checks b/c its always good to know where something might have errored in
your test cases.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Fix most staticcheck lint issues

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup deprecated call to snappy.NewWriter

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Remove rev from Makefile

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Reorder imports

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ignoring this for now

We have opened up issue
cortexproject/cortex#2015 to address the
deprecation of this type.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Explicitly ignoring this error

The test is currently failing due to a data race. I believe it is due to
this bug in golang.

golang/go#30597

As far as this test cares it does not really matter that this happens so
removing the need to check for NoError "fixes" it.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Require noerror since this is a test

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Switch over to use require.NoError

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Move func to test class since that is only place it was used

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log warning if save to cache errors

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Condense a little

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Use returned error instead of capturing it

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Bringing back ctx and adding comment

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Log error if changing ring state fails when Leaving

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If context deadline exceeded return the error

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Can't defer this otherwise we will have no data

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Comment to make it clear why this nolint was added

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Refactor method out

Since Fixture is already in testutils and it is being used in both
places pulled it out into a common helper method in the testutils
package.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* io.Copy added to global errcheck exclude

Signed-off-by: Nathan Zender <github@nathanzender.com>

* If error dont do anything else

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup unused function

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Adding tracer to global excludes

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Cleanup post rebase

Formatting and import issues that got missed when merging.

Signed-off-by: Nathan Zender <github@nathanzender.com>

* Ratelimiter returns resource exhausted error

This is necessary so that when it is used with the backoff retry it will
allow for the backoff to continue to work as expected.

Signed-off-by: Nathan Zender <github@nathanzender.com>
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 a pull request may close this issue.

2 participants