akumulid process crashed after executing query api
webfolderio opened this issue · 1 comments
Hi,
Akumuli process crashed with the following test case.
1) Create an empty database
akumulid --init
akumulid --create
2) Write the datapoint to Akumuli via tcp port
echo +cpu.usage location=xyz\r\n:1574238775394000000\r\n:10\r\n | netcat localhost 8282
3) Query the datapoint
curl --header "Content-Type: application/json" --request POST --data '{"select":"cpu.usage","range":{"from":"20191110T113255.72","to":"20191130T113255.72"},"group-by-tag":["location"]}' http://localhost:8181/api/query
Akumuli was abnormally crashed after the step 3 with following error message:
Aborted (core dumped)
OS: Ubuntu 18.04.3
Akumuli version: 0.8.72 (installed from deb package)
Hi,
The first problem is the use of "echo" command. It sends "\r\n" literally, like sequence of four character, without escaping. It can be fixed by switching to printf command:
printf "+cpu.usage location=xyz\n1574238775394000000\n:10\n" | netcat localhost 8282
It can be easily fixed.
The second problem is on akumulis's side. The ill-formed write sequence can create empty time-series without any data-points inside. This empty time-series can make some queries fail. This should be fixed soon. I'll keep this issue open as long as it's not fixed.