Bug: Send to closed channel
Open
Nobody has claimed this yet.
bug
- Dominant language
- Go
- Stars
- 131
- Forks
- 16
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 11
Description
I started seq-db in single mode with following flags:
--total-size=64KB;--frac-size=32KB;
After that I wrote some logs and caught a panic with following message:
{"level":"info","ts":"2025-03-21T16:16:59.351+0300","message":"frac cache saved to disk","filepath":"/tmp/tmp.F1PfSOmYu9/.frac-cache","version":2}
panic: send on closed channel
goroutine 976 [running]:
gitlab.ozon.ru/sre/seq-db/frac.(*ActiveAppender).In(0xc0000d0888, 0xc0000d07e0, {0xc001e862a0, 0x9e, 0xd8}, {0xc002488000, 0xfa, 0x100}, 0xc00043e5c8, 0xc0000d0880)
gitlab.ozon.ru/sre/seq-db/frac/active_appender.go:106 +0x3d0
gitlab.ozon.ru/sre/seq-db/frac.(*Active).Append(0xc0000d07e0, {0xc001e862a0, 0x9e, 0xd8}, {0xc002488000, 0xfa, 0x100}, 0xc00043e5c8)
gitlab.ozon.ru/sre/seq-db/frac/active.go:333 +0xa5
gitlab.ozon.ru/sre/seq-db/fracmanager.(*FracManager).Append(0xc00043a000, {0xfde3a8, 0xc0024865d0}, {0xc001e862a0, 0x9e, 0xd8}, {0xc002488000, 0xfa, 0x100}, 0xc00043e5c8)
gitlab.ozon.ru/sre/seq-db/fracmanager/frac_manager.go:357 +0x132
gitlab.ozon.ru/sre/seq-db/storeapi.(*GrpcV1).doBulk(0xc0000120e0, {0xfde3a8, 0xc0024865d0}, 0xc002481020)
gitlab.ozon.ru/sre/seq-db/storeapi/grpc_bulk.go:53 +0x1b6
gitlab.ozon.ru/sre/seq-db/storeapi.(*GrpcV1).Bulk(0xc0000120e0, {0xfde450?, 0xc002157810?}, 0xc002481020)
gitlab.ozon.ru/sre/seq-db/storeapi/grpc_bulk.go:26 +0x1a5
gitlab.ozon.ru/sre/seq-db/storeapi.inMemoryAPIClient.Bulk({0xc002143380?}, {0xfde450?, 0xc002157810?}, 0xc002481020?, {0x20?, 0xd20600?, 0x1?})
gitlab.ozon.ru/sre/seq-db/storeapi/client.go:26 +0x111
gitlab.ozon.ru/sre/seq-db/proxy/bulk.sendBulkToHost({0xfde450, 0xc002157810}, {{0xe98fdf?, 0xc00029b7b8?}, {0xfde878?, 0xc00041a868?}}, 0xc002481020)
gitlab.ozon.ru/sre/seq-db/proxy/bulk/seqdb_client.go:195 +0x122
gitlab.ozon.ru/sre/seq-db/proxy/bulk.(*SeqDBClient).sendBulkToStores.(*shard).Bulk.func1.1()
gitlab.ozon.ru/sre/seq-db/proxy/bulk/seqdb_client.go:178 +0x69
created by gitlab.ozon.ru/sre/seq-db/proxy/bulk.(*SeqDBClient).sendBulkToStores.(*shard).Bulk.func1 in goroutine 921
gitlab.ozon.ru/sre/seq-db/proxy/bulk/seqdb_client.go:177 +0x274
make: *** [Makefile:34: run] Error 2
I haven't tested such flags when proxy and store are running, but I believe the bug will remain.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with frac/active_appender.go:106 and trace the close and send lifecycle through frac/active.go:333. Reproduce in single mode with --total-size=64KB and --frac-size=32KB, then exercise the log-writing path shown in the report. Done means the workload no longer panics with "send on closed channel".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100