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 upfatal error: concurrent map iteration and map write #3735
Comments
This comment has been minimized.
This comment has been minimized.
|
@tonobo it might help if you can provide a minimal config to replicate the issue. @cstyan any idea why this might happen? the locks seem properly used in
|
This comment has been minimized.
This comment has been minimized.
|
@krasi-georgiev This happend after 6 days uptime. I'm running the following config. alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9095
global:
evaluation_interval: 15s
scrape_interval: 15s
rule_files:
- /etc/prometheus/rules.d/*.yml
- /etc/prometheus/git_rules.d/*.yml
scrape_configs:
- job_name: elastic_node
metrics_path: /node_metrics
scrape_interval: 10s
scrape_timeout: 10s
static_configs:
- targets:
- elastic1.example.de:9009
- elastic2.example.de:9009
- elastic3.example.de:9009
- job_name: prometheus
scrape_interval: 10s
scrape_timeout: 10s
static_configs:
- targets:
- localhost:9090
- targets:
- localhost:9100
- file_sd_configs:
- files:
- /etc/prometheus/targets.d/xxx_*.json
job_name: xxx
scrape_interval: 30s
scrape_timeout: 30s |
This comment has been minimized.
This comment has been minimized.
|
the panic happens in the file service discovery so I think we would need the json files to replicate it.
|
This comment has been minimized.
This comment has been minimized.
|
I don't think the JSON files would help. We have all the details here, I think :) https://github.com/prometheus/prometheus/blob/master/discovery/file/file.go#L99-L101 This is reading the Now the issue is that we are doing While we are locking writes using a completely different lock: https://github.com/prometheus/prometheus/blob/master/discovery/file/file.go#L274 ( cc @cstyan |
This comment has been minimized.
This comment has been minimized.
|
There are 1838 json files, do you want all of them? Is it really required? |
This comment has been minimized.
This comment has been minimized.
|
@gouthamve ok, i think so :D |
This comment has been minimized.
This comment has been minimized.
|
@gouthamve ooh , shoot , I completely overlooked this , that would be an easy fix than. |
This comment has been minimized.
This comment has been minimized.
|
Looks like a simple fix as @gouthamve pointed out. I would like to claim this issue! |
This comment has been minimized.
This comment has been minimized.
|
@codesome go ahead :) green light... |
codesome
added a commit
to codesome/prometheus
that referenced
this issue
Jan 25, 2018
codesome
referenced this issue
Jan 25, 2018
Merged
Fixed race condition in map iteration and map write in Discovery (#3735) #3738
gouthamve
added a commit
that referenced
this issue
Jan 28, 2018
This comment has been minimized.
This comment has been minimized.
|
Closed by: #3738 |
gouthamve
closed this
Jan 28, 2018
gouthamve
referenced this issue
Mar 14, 2018
Closed
Prometheus 2.1.0 crashes with fatal error: concurrent map iteration and map write #3960
rajatjindal
referenced this issue
Oct 10, 2018
Open
fatal error: concurrent map iteration and map write #4753
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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. |
tonobo commentedJan 25, 2018
What did you do?
Just a few queries and scraping ~1,5k targets.
Environment
The whole go panic: prom.log.gz