Open danelkotev opened 1 month ago
I was able to reproduce this. Curiously it seems like it worked up to 42 secret
backends, but when I did 43 is when it hung. Reproduction steps:
Use this jsonnet config:
local arr = std.range(1, std.extVar("n"));
{
"secret": {
[std.format("secret_%03d", i)]: {
"type": "exec",
"command": [
"./secret.sh"
]
}
for i in arr
},
"sources": {
[std.format("source_%03d", i)]: {
"type": "demo_logs",
"format": std.format("SECRET[secret_%03d.format]", i),
"interval": 1.0
}
for i in arr
},
"sinks": {
[std.format("sink_%03d", i)]: {
"type": "blackhole",
"inputs": [
std.format("source_%03d", i)
],
"print_interval_secs": 1,
}
for i in arr
}
}
In secret.sh
put:
echo '{ "format": {"value": "json", "error": null} }'
Generate a config with 43 secret backends: jsonnet vector.jsonnet --ext-code n=43 | tee vector.json
Run vector --config vector.json
.
Observe that Vector hangs on start-up. If you try 42 it loads correctly.
Problem
We use
vector.dev
in production and for Azure Blog Storage sink we usesecret
of typeexec
that runs some script. We create a configuration file per customer, but the configuration is very similar to all: Kafka source, filter on Kafka header, Azure sink. When reaching 41 config files vector gets stuck, CPU reaches more than 100%.I tried many alternatives:
echo
cmdNothing changes the behavior, hence I believe there is a bug that will also apply in AWS Secret option since as I see it there is an issue with
stdin
blocking.Sharing that I debugged it and try to solve the issue, seams like the issue is with
query_backend
where after some secret loading, the stdout doesn't switch to None, the only thing that fixed it - is something like (see the break - I don't think it's a good solution thought, but it solved the issue):Step to reproduce:
Version
0.28.1, 0.40.0