Skip to content

Conversation

cyriltovena
Copy link
Contributor

This was happening because of a race.
I've change the test suite to cover the code and the race detector shows it up.

The panic:

panic: runtime error: index out of range [1] with length 1

goroutine 26118 [running]:
github.com/cortexproject/cortex/tools/querytee.(*ProxyEndpoint).executeBackendRequests(0xc0003160c0, 0xc0002c2600, 0xc0004c44e0)
	/__w/cortex/cortex/tools/querytee/proxy_endpoint.go:122 +0x5a5
created by github.com/cortexproject/cortex/tools/querytee.(*ProxyEndpoint).ServeHTTP
	/__w/cortex/cortex/tools/querytee/proxy_endpoint.go:57 +0x25b

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

This was happening because of a race.
I've change the test suite to cover the code and the race detector shows it up.

The panic:

```
panic: runtime error: index out of range [1] with length 1

goroutine 26118 [running]:
github.com/cortexproject/cortex/tools/querytee.(*ProxyEndpoint).executeBackendRequests(0xc0003160c0, 0xc0002c2600, 0xc0004c44e0)
	/__w/cortex/cortex/tools/querytee/proxy_endpoint.go:122 +0x5a5
created by github.com/cortexproject/cortex/tools/querytee.(*ProxyEndpoint).ServeHTTP
	/__w/cortex/cortex/tools/querytee/proxy_endpoint.go:57 +0x25b
```

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@alvinlin123 alvinlin123 merged commit 74055d8 into cortexproject:master Sep 7, 2021
alvinlin123 pushed a commit to ac1214/cortex that referenced this pull request Jan 14, 2022
* Fixes a panic in the query-tee.

This was happening because of a race.
I've change the test suite to cover the code and the race detector shows it up.

The panic:

```
panic: runtime error: index out of range [1] with length 1

goroutine 26118 [running]:
github.com/cortexproject/cortex/tools/querytee.(*ProxyEndpoint).executeBackendRequests(0xc0003160c0, 0xc0002c2600, 0xc0004c44e0)
	/__w/cortex/cortex/tools/querytee/proxy_endpoint.go:122 +0x5a5
created by github.com/cortexproject/cortex/tools/querytee.(*ProxyEndpoint).ServeHTTP
	/__w/cortex/cortex/tools/querytee/proxy_endpoint.go:57 +0x25b
```

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

* update changelog.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Alvin Lin <alvinlin@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants