influxdata / influxdata/kapacitor

Panic on over UDF

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

Description

I get an error:

panic: send on closed channel

goroutine 1744 [running]:
github.com/influxdata/kapacitor/edge.(*channelEdge).Collect(0xc004d4ddd0, 0x7f8ba5e7d7a8, 0xc2f52e6cf0, 0x407b03, 0xc00599e180)
/root/go/src/github.com/influxdata/kapacitor/edge/edge.go:58 +0xc3
github.com/influxdata/kapacitor/edge.(*streamStatsEdge).Collect(0xc003c43bc0, 0x7f8ba5e7d7a8, 0xc2f52e6cf0, 0x0, 0x0)
/root/go/src/github.com/influxdata/kapacitor/edge/stats.go:207 +0x4b
github.com/influxdata/kapacitor/edge.Forward(0xc0012d8260, 0x1, 0x1, 0x7f8ba5e7d7a8, 0xc2f52e6cf0, 0x0, 0x0)
/root/go/src/github.com/influxdata/kapacitor/edge/forwarding.go:104 +0x72
github.com/influxdata/kapacitor.(*UDFNode).runUDF.func2(0xc0029a77c0, 0xc006342c00)
/root/go/src/github.com/influxdata/kapacitor/udf.go:96 +0xc1
created by github.com/influxdata/kapacitor.(*UDFNode).runUDF
/root/go/src/github.com/influxdata/kapacitor/udf.go:93 +0x146

I use UDF without socket.
The handler closing i'm using the standard:
// Stop the handler gracefully.
func (a *objectHandler) Stop() {
close(a.agent.Responses)
}

The error occurs when processing a large number of tags at the time of changing the severity level.
Kapacitor version 1.5.2

Contributor guide

Open the contributing guide

Research direction

Reproduce the UDF-without-socket case while processing many tags during a severity-level change. Read edge/edge.go, edge/stats.go, edge/forwarding.go, and udf.go, then inspect how the handler's Stop method closes Responses. Done means this shutdown path no longer panics with "send on closed channel".

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.