mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql: make a copy of EvalConfig when executing q1
and q2
in parallel for q1 binary_op q2
This should prevent from data races if the underlying functions modify EvalConfig contents.
This commit is contained in:
parent
985c3e301d
commit
5973fd4067
1 changed files with 4 additions and 2 deletions
|
@ -295,7 +295,8 @@ func evalExpr(ec *EvalConfig, e metricsql.Expr) ([]*timeseries, error) {
|
|||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
tss, err := evalExpr(ec, be.Left)
|
||||
ecCopy := *ec
|
||||
tss, err := evalExpr(&ecCopy, be.Left)
|
||||
mu.Lock()
|
||||
if err != nil {
|
||||
if errGlobal == nil {
|
||||
|
@ -308,7 +309,8 @@ func evalExpr(ec *EvalConfig, e metricsql.Expr) ([]*timeseries, error) {
|
|||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
tss, err := evalExpr(ec, be.Right)
|
||||
ecCopy := *ec
|
||||
tss, err := evalExpr(&ecCopy, be.Right)
|
||||
mu.Lock()
|
||||
if err != nil {
|
||||
if errGlobal == nil {
|
||||
|
|
Loading…
Reference in a new issue