Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upExpression evaluation code is not goroutine-safe #127
Comments
ghost
assigned
juliusv
Apr 10, 2013
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
In an IM, Matt writes:
We're still in exploratory mode, but I'll definitely do this long-term. The context here is getting instantaneous values for the purposes of alerting. A "rule" is a precomputed expression? (Where does the "rule" terminology come from?) A side-question I was going to raise later is: how do I construct an expression to get a scalar value (say average) over a certain time window? "Windowing" is exposed in the Graph UI as Range, but not in the expression grammar or query API as far as I could tell. |
This comment has been minimized.
This comment has been minimized.
|
Right, this is a known caveat still and I just didn't think anyone would hit it that early on in the experimental phase: https://github.com/prometheus/prometheus/blob/master/rules/load.go#L25 I'll prioritize this. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Yeah, quite impressive, since the parsing time should be so negligibly small compared to the rest of the expression evaluation that it should be quite hard to trigger this condition under normal circumstances. In fact, I haven't managed to recreate it yet with 4 parallel curls, but they are probably just too slow. I think I'll just wrap the entire parser in a lock, since goyacc/golex don't give me much better options :-/ |
juliusv
closed this
Apr 15, 2013
simonpasquier
pushed a commit
to simonpasquier/prometheus
that referenced
this issue
Oct 12, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 25, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |

peterbourgon commentedApr 10, 2013
To reproduce, create a small program which launches concurrent requests to
prometheus/api/query?json=JSON&expr=<anything>. Each request will have one of three possible outcomes:For the record, the panic has this stacktrace: