Skip to content

Commit

Permalink
Cut patch release v0.36.1 (thanos-io#7636)
Browse files Browse the repository at this point in the history
* Proxy: Query goroutine leak when `store.response-timeout` is set (thanos-io#7618)

time.AfterFunc() returns a time.Timer object whose C field is nil,
accroding to the documentation. A goroutine blocks forever on reading
from a `nil` channel, leading to a goroutine leak on random slow
queries.

Signed-off-by: Mikhail Nozdrachev <[email protected]>

* pkg/clientconfig: fix TLS configs with only CA (thanos-io#7634)

065e3dd introduced a regression: TLS configurations for Thanos Ruler
query and alerting with only a CA file failed to load.

For instance, the following snippet is a valid query configuration:

```
- static_configs:
  - prometheus.example.com:9090
  scheme: https
  http_config:
    tls_config:
      ca_file: /etc/ssl/cert.pem
```

The test fixtures (CA, certificate and key files) are copied from
prometheus/common and are valid until 2072.

Signed-off-by: Simon Pasquier <[email protected]>

* Cut patch release v0.36.1

Signed-off-by: Saswata Mukherjee <[email protected]>

* Fix failing e2e test (thanos-io#7620)

Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>

---------

Signed-off-by: Mikhail Nozdrachev <[email protected]>
Signed-off-by: Simon Pasquier <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]>
Co-authored-by: Mikhail Nozdrachev <[email protected]>
Co-authored-by: Simon Pasquier <[email protected]>
Co-authored-by: Harry John <[email protected]>
  • Loading branch information
4 people authored and hczhu-db committed Aug 22, 2024
1 parent 6ec898b commit 3fc9e64
Show file tree
Hide file tree
Showing 10 changed files with 272 additions and 17 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.36.0
0.36.1
6 changes: 3 additions & 3 deletions cmd/thanos/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func runRule(
if len(conf.queryConfigYAML) > 0 {
queryCfg, err = clientconfig.LoadConfigs(conf.queryConfigYAML)
if err != nil {
return err
return errors.Wrap(err, "query configuration")
}
} else {
queryCfg, err = clientconfig.BuildConfigFromHTTPAddresses(conf.query.addrs)
Expand Down Expand Up @@ -382,12 +382,12 @@ func runRule(
cfg.HTTPConfig.HTTPClientConfig.ClientMetrics = queryClientMetrics
c, err := clientconfig.NewHTTPClient(cfg.HTTPConfig.HTTPClientConfig, "query")
if err != nil {
return err
return fmt.Errorf("failed to create HTTP query client: %w", err)
}
c.Transport = tracing.HTTPTripperware(logger, c.Transport)
queryClient, err := clientconfig.NewClient(logger, cfg.HTTPConfig.EndpointsConfig, c, queryProvider.Clone())
if err != nil {
return err
return fmt.Errorf("failed to create query client: %w", err)
}
queryClients = append(queryClients, queryClient)
promClients = append(promClients, promclient.NewClient(queryClient, logger, "thanos-rule"))
Expand Down
17 changes: 12 additions & 5 deletions pkg/clientconfig/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,18 @@ func NewRoundTripperFromConfig(cfg config_util.HTTPClientConfig, transportConfig
return newRT(tlsConfig)
}

return config_util.NewTLSRoundTripper(tlsConfig, config_util.TLSRoundTripperSettings{
CA: config_util.NewFileSecret(cfg.TLSConfig.CAFile),
Cert: config_util.NewFileSecret(cfg.TLSConfig.CertFile),
Key: config_util.NewFileSecret(cfg.TLSConfig.KeyFile),
}, newRT)
rtConfig := config_util.TLSRoundTripperSettings{
Cert: config_util.NewFileSecret(cfg.TLSConfig.CAFile),
}
if len(cfg.TLSConfig.CertFile) > 0 {
rtConfig.Cert = config_util.NewFileSecret(cfg.TLSConfig.CertFile)
}

if len(cfg.TLSConfig.KeyFile) > 0 {
rtConfig.Key = config_util.NewFileSecret(cfg.TLSConfig.KeyFile)
}

return config_util.NewTLSRoundTripper(tlsConfig, rtConfig, newRT)
}

// NewHTTPClient returns a new HTTP client.
Expand Down
95 changes: 95 additions & 0 deletions pkg/clientconfig/http_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.

package clientconfig

import (
"testing"

"github.com/efficientgo/core/testutil"
)

func TestNewHTTPClientConfigFromYAML(t *testing.T) {
for _, tc := range []struct {
desc string
cfg HTTPClientConfig
err bool
}{
{
desc: "empty string",
cfg: HTTPClientConfig{},
err: false,
},
{
desc: "missing CA file",
cfg: HTTPClientConfig{
TLSConfig: TLSConfig{
CAFile: "xxx",
},
},
err: true,
},
{
desc: "invalid CA file",
cfg: HTTPClientConfig{
TLSConfig: TLSConfig{
CAFile: "testdata/invalid.pem",
},
},
err: true,
},
{
desc: "valid CA file",
cfg: HTTPClientConfig{
TLSConfig: TLSConfig{
CAFile: "testdata/tls-ca-chain.pem",
},
},
err: false,
},
{
desc: "invalid cert file",
cfg: HTTPClientConfig{
TLSConfig: TLSConfig{
CAFile: "testdata/tls-ca-chain.pem",
CertFile: "testdata/invalid.pem",
KeyFile: "testdata/self-signed-client.key",
},
},
err: true,
},
{
desc: "invalid key file",
cfg: HTTPClientConfig{
TLSConfig: TLSConfig{
CAFile: "testdata/tls-ca-chain.pem",
CertFile: "testdata/self-signed-client.crt",
KeyFile: "testdata/invalid.pem",
},
},
err: true,
},
{
desc: "valid CA, cert and key files",
cfg: HTTPClientConfig{
TLSConfig: TLSConfig{
CAFile: "testdata/tls-ca-chain.pem",
CertFile: "testdata/self-signed-client.crt",
KeyFile: "testdata/self-signed-client.key",
},
},
err: false,
},
} {
t.Run(tc.desc, func(t *testing.T) {
_, err := NewHTTPClient(tc.cfg, "")
if tc.err {
t.Logf("err: %v", err)
testutil.NotOk(t, err)
return
}

testutil.Ok(t, err)
})
}
}
Empty file.
30 changes: 30 additions & 0 deletions pkg/clientconfig/testdata/self-signed-client.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIFLjCCAxagAwIBAgIRAMMSh5NoexSCjSvDRf1fpgUwDQYJKoZIhvcNAQELBQAw
NjELMAkGA1UEBhMCVVMxEzARBgNVBAoTClByb21ldGhldXMxEjAQBgNVBAM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Pt0jhMRpNxCf16dAMoyIoWNas88vU2Mef90Chfj
8e6wLtzqAquX/ruwIfsOMnbcSGuh+y54DspCXgsTZ9cnCI2lnQroXZi4WUqi3Enj
mFPpVc+mMlffGW6LISo3ehRLA7k3/01yJhqzpTQw44k9ZfJ7VXZTRJKJsaqeljzV
VfzDbDfW8ftbZ8IWQGAOQfTa23aHIYcvJfvyxpfQRyrwRxjGytLHoOH/G+1TZuOt
KBJ2Xdi9qrr+Wep4eNJm2cTBd1Fpr0hWZ9K27BwwYdZZF8Eu8eP8hSeRmA4PqzAj
HauCl8PgWJIWzMloXVZaGxiYX7sGVs79m/Yl9A6+p8RTpK7DVB9+sDIiD2bhiZqL
i9YWM8aD2cR20t2ZkuBBPlVTOouF/WotOWrLhT4J+SngkdmLkAjP/5jPFvpTfeGi
THyAmp4gigwaM0nIZskPcPCbkk+zFYPToyS49ZJwQMzqK2hkjyQ9LyzUdo9vlDjL
8lFjlUZzqaR0DF3pbf8fs5/16gPurR65SU/ebOs+uxZLYJrP2zKmeISE+q4AMudc
rQ0Z6KmGUiXnIvpB105UJ7jlXCxbsruc8gRTbjkgW7yoXg==
-----END CERTIFICATE-----
52 changes: 52 additions & 0 deletions pkg/clientconfig/testdata/self-signed-client.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC7a18Zx6+3lDO1
4e2sGC8KJqZrs5202v/PjrIoUmnpVDekQ7AHZu3jjAOyjKmQeTTn3g6hKjCFKGqE
NYMyJtASeHQoIvfUpwPG9DIwBqlKUSd4Cy0l7D2ueuO4MVEj+c0NIVjDIBmsOKyf
SwzrVM9kvHbaikx615d+JqXbC62ci18Ms/FCfNyatjYMeHAKWa27PoNV5TEVfFYf
PWdm5G2ypg2JiDoU3hNcC3a2f13nBDr5BmXI921ojv8k5z/JkxEdoU70sVK6ch5/
+eS5FPD0esAju4Z7WfSy1sYP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CahenDnb+TuUstp+M8OhSsCggEBANw/9gJ65yi9ohWv7MY2
g+maI+gFk3tAnPOGFnR9TqGxdidKc2CeBtDS2/FUhXFzif5jOI5oFUToSjmW5bwH
wchfXn0gjqh9+0T9pkjw/tv9QuCHKyuM1noC1t2CVliF/j8U4X+X9+sN6RakpWLx
SVuZAoXnbfNHqoHbFToei8W9Vi2jSf7bOlRsbGPZcZtHwLonp7pDBAeHeSbF5dNn
BPWehHTQjHolqBhjzHPP2NxIDcIXkg00b6Ehvoc4XXAYpSvR+pmp1gGorUo57pbt
JSe2kVVRDwgPOAYuuWUWFFH9zuiE6WKxnb7ts+4VKRAVHCwXIjTpjN+Rxj+MsIDH
fPcCggEBAIRgZPwB6eI+rvYOPUGSeU681O+8/ZgjyAi8HSOk3dCc3J2fX31m/GsR
xM+FExbGYJ3BfdgB9YbLSI8eY7weJRodm0FoCuHePu81z4xj9yEi5hBodXhhDjQM
/xbgsSWeotQ+5lTmc5hgve1hl+3t09qNttHaELWASD+0ixBC6A6J4GB68ZKRIunW
+ZGiEvrNey6Uunf7T/Wgc+VDcA3HsniaY2yTZY/jWsmDxt/BAwUaQrNwAbHvm/1P
J04mvCreWfOITe7CURcLq4FMGzsCEXtdQ77/uJllew1Uv2Yn2WFUiqVxH+UicR1P
vOJ7/LvbOa8BlIMsprB2rz3PDSUSaIw=
-----END PRIVATE KEY-----
67 changes: 67 additions & 0 deletions pkg/clientconfig/testdata/tls-ca-chain.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
-----BEGIN CERTIFICATE-----
MIIF1DCCA7ygAwIBAgIRAMMSh5NoexSCjSvDRf1fpgIwDQYJKoZIhvcNAQELBQAw
ajELMAkGA1UEBhMCVVMxEzARBgNVBAoTClByb21ldGhldXMxKTAnBgNVBAsTIFBy
b21ldGhldXMgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDExJQcm9tZXRo
ZXVzIFJvb3QgQ0EwIBcNMjIwNzA4MDkxNTA2W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X2R7/RgxWqB7FNS+S0xfGyeUb3YPVPI1yhtsKa
6mCtTuCVgsgs/hTa+umjtffxj7l+IQxD8Fq0RFBae+S0v5mjVC2sUVd6usqVt7F6
LUVuYShyAI705guIV9nkz8ZyLzUBJnQAJ8g6DU+nLmdizigUG+JoD/hBbK2hvcjX
SL7JLAhYRI4kzWcYR0GUfDf2knFEWNhU8gCPnw70FHMD9QC3NKkQsPvyQRyJh99+
ipwUFbGJJRYWjFBbUxlqZNqBg6+ylZNFGEnG42u2KvPXjgPdivlQWkrX6nG0ayyl
rYrvi0FawP3OBpCrhYhqsqkA2m+5L2Pl+J2SsDv4qmPB6fh7K0YDVB37AZSG+nfL
oXXpUtwfc9tR71S7GmgkcqYOkHfSzl7ecxXtE2xyl3zhkUPR9YcG+rQhXRRp0lxF
kR0EtGOGuvXMCQ/vBVPNEDS3jdceqIrIRI1yPUdhFkF7lrLsfFULllOt6qQWnhn2
A2ObxHToohwuyri/v8QhqNI2Bg0jJHcAJi8I8taToAstCWrtn+WXyfj/QknAik47
aOK9l5wSyyqPfkHybKvT6z9pqWUchJsz
-----END CERTIFICATE-----
8 changes: 6 additions & 2 deletions pkg/store/proxy_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ func newLazyRespSet(
var rerr error
// If timer is already stopped
if t != nil && !t.Stop() {
<-t.C // Drain the channel if it was already stopped.
if t.C != nil {
<-t.C // Drain the channel if it was already stopped.
}
rerr = errors.Wrapf(err, "failed to receive any data in %s from %s", l.frameTimeout, st)
} else {
rerr = errors.Wrapf(err, "receive series from %s", st)
Expand Down Expand Up @@ -643,7 +645,9 @@ func newEagerRespSet(
var rerr error
// If timer is already stopped
if t != nil && !t.Stop() {
<-t.C // Drain the channel if it was already stopped.
if t.C != nil {
<-t.C // Drain the channel if it was already stopped.
}
rerr = errors.Wrapf(err, "failed to receive any data in %s from %s", l.frameTimeout, storeName)
} else {
rerr = errors.Wrapf(err, "receive series from %s", storeName)
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/receive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,9 @@ test_metric{a="2", b="2"} 1`)
e2ethanos.AvalancheOptions{
MetricCount: "10",
SeriesCount: "1",
MetricInterval: "30",
SeriesInterval: "3600",
ValueInterval: "3600",
MetricInterval: "3600",
SeriesInterval: "30",
ValueInterval: "30",

RemoteURL: e2ethanos.RemoteWriteEndpoint(ingestor1.InternalEndpoint("remote-write")),
RemoteWriteInterval: "30s",
Expand Down Expand Up @@ -886,9 +886,9 @@ test_metric{a="2", b="2"} 1`)
e2ethanos.AvalancheOptions{
MetricCount: "10",
SeriesCount: "1",
MetricInterval: "30",
SeriesInterval: "3600",
ValueInterval: "3600",
MetricInterval: "3600",
SeriesInterval: "30",
ValueInterval: "30",

RemoteURL: e2ethanos.RemoteWriteEndpoint(ingestor1.InternalEndpoint("remote-write")),
RemoteWriteInterval: "30s",
Expand Down

0 comments on commit 3fc9e64

Please sign in to comment.