influxdata / influxdata/kapacitor

Enabling a TICK script with just stats() breaks Kapacitor

Open
#2,079 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

While trying to generate regular heartbeat events from Kapacitor I stumbled on an issue where a tick script with just a `stats` node locks up all task related operations.

So that when I enable this:
```
stream
|stats(5s)
|log()
```
It actually works and I can observe the log being emitted. However when I try to redefine, delete or disable the task, the operation hangs. What's worse now *all* operations on *other* tasks also hang until I restart Kapacitor. After the restart I can operate on other tasks, but touching this one again causes Kapacitor to lock up.

I'm also unable to delete the task unless I initiate a `disable` followed by Kapacitor restart (the `disable` by itself would never finish).

This is reproducable on a freshly installed 1.5.1 running just this one task. Thread dump from SIGQUITing the kapacitord attached.

[threaddump.txt](https://github.com/influxdata/kapacitor/files/2504996/threaddump.txt)

The workaround I found was to add an empty `from()` node, so that the script becomes:
```
stream
|from()
|stats(5s)
|log()
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the minimal Kapacitor tick script using stream, stats(5s), and log(), then exercise task redefine, delete, and disable operations. Compare it with the version containing an empty from() node and inspect the attached threaddump.txt; done means task operations no longer hang and other tasks remain usable without restarting Kapacitor.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.