-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
net/http: data race when response is returned before the full request's body is written #30597
Comments
Are you positive that the race is in net/http and not your use of it? If you're not sure, have you tried asking on one of the forums for help? |
No, I'm not positive and I haven't ask on the forums. Though, there is nothing said in I will try to post on forums to ensure that this is not my fault. If it is, it would mean that one cannot change fields in |
https://groups.google.com/forum/#!topic/golang-nuts/1rst28pnlt8 The problem is not |
I'm sorry but could you point out where I use it simultaneously? I create new(!) reader for each goroutine. If you want, you can remove this goroutine stuff and have single infinite Single thread racepackage main
import (
"crypto/rand"
"fmt"
"io"
"io/ioutil"
"net/http"
"sync"
"time"
)
const (
addr1 = "localhost:8060"
addr2 = "localhost:8061"
)
type customReader struct {
iter int
size int
}
func (r *customReader) Read(b []byte) (int, error) {
maxRead := r.size - r.iter
if maxRead == 0 {
return 0, io.EOF
}
if maxRead > len(b) {
maxRead = len(b)
}
n, err := rand.Read(b[:maxRead])
r.iter += maxRead
return n, err
}
func (r *customReader) Close() error {
// Uncomment this for even more races :((
// r.iter = 0
return nil
}
func (r *customReader) Reset() {
r.iter = 0
}
func second(w http.ResponseWriter, r *http.Request) {
ioutil.ReadAll(r.Body)
}
func first(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "http://"+addr2+"/second", http.StatusTemporaryRedirect)
}
func main() {
mux1 := http.NewServeMux()
mux1.HandleFunc("/first", first)
srv1 := http.Server{
Addr: addr1,
Handler: mux1,
}
go func() {
err := srv1.ListenAndServe()
fmt.Printf("err: %v", err)
}()
mux2 := http.NewServeMux()
mux2.HandleFunc("/second", second)
srv2 := http.Server{
Addr: addr2,
Handler: mux2,
}
go func() {
err := srv2.ListenAndServe()
fmt.Printf("err: %v", err)
}()
time.Sleep(time.Second)
client := http.DefaultClient
reader := &customReader{size: 900000}
for {
req, err := http.NewRequest(http.MethodPut, "http://"+addr1+"/first", r)
if err != nil {
fmt.Printf("%v", err)
}
req.GetBody = func() (io.ReadCloser, error) {
return &customReader{size: 900000}, nil
}
if resp, err := client.Do(req); err != nil {
// fmt.Printf("error: %v", err)
} else if resp.StatusCode >= http.StatusBadRequest {
// fmt.Printf("status code: %d", resp.StatusCode)
}
// Reset reader and try to reuse it in next request
r.Reset()
}
srv1.Close()
srv2.Close()
} |
The problem is with your reader. iter is being updated in multiple goroutines, via Read() and Reset(). The underlying http transport is not guaranteed to use a single goroutine to handle your request/response. Although on my machine, I never got a data race detection, but call me lucky in this case. |
But how is that possible?
And I don't expect it to use single goroutine. It can use two or million of goroutines. I don't care as long as it does it safely. If safety is on my (user) side then I would expect that 99.9% implementations that use readers in |
I'm sorry for incorrect claim. I've run your code in debugger and read The relevant code responsible for processing request/response is in transport: https://github.com/golang/go/blame/master/src/net/http/transport.go#L2164 @bradfitz done a lot of changes in transport and probably can tell you more, especially confirm or deny my implicit assumption about the |
You haven't closed your Response.Body, so the Transport is still handling (thus, owning) the request when you Reset its Body. |
Closing Response.Body doesn't solve the problem. Brad, I've read the code in transport.go. There's a
and the Because VirrageS is reusing the I've also simplified the example provided by VirrageS:
The error appeared on redirection but it's not the clue of the problem. To duplicate the issue writing the body must take more time the response from server, manipulating the size of the body helps.
|
@bradfitz I believe the issue may be that there is no guarantee that the writeLoop is finished. The writeLoopDone channel is only checked on a broken connection. |
I've verified. The issue is reproducible in 1.12.6. The Line 358 in 2012227
was encapsulated: Line 348 in 88548d0
However, the I've checked The solutions I see are:
@bradfitz I'm happy to contribute the fix, but someone must make decision. |
@orian Thanks for looking into this issue! Another thing that worried me a little in But this probably needs another issue and separate discussion. |
@andybons could you change the bug name to "net/http: data race when response is returned before the full request's body is written" or something similar? Also, I think the Go' client implementation does not follow RFC2616 "8.2.2 Monitoring Connections for Error Status Messages" (https://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html):
@VirrageS a master' version of |
Was there any decision made regarding this issue? |
Ping @bradfitz regarding #30597 (comment) . |
this is also happening when trying to use the DumpRequestOut: https://golang.org/pkg/net/http/httputil/#DumpRequestOut |
ping @bradfitz |
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
Nope, it was intentional. I should have left the comment. In the documentation there are no guarantees on when the |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run following script with:
go run -race concept.go
What did you expect to see?
No races
What did you see instead?
Races:
The text was updated successfully, but these errors were encountered: