influxdata / influxdata/influxdb

fatal error: concurrent map iteration and map write

Open
#21,326 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

i use influxdb-1.8.0_linux_amd64.tar.gz
and met this problem:

> fatal error: concurrent map iteration and map write
goroutine 426254371 [running]:
runtime.throw(0x168582c, 0x26)
/usr/local/go/src/runtime/panic.go:774 +0x72 fp=0xc01a099808 sp=0xc01a0997d8 pc=0x431272
runtime.mapiternext(0xc01a0998a8)
/usr/local/go/src/runtime/map.go:858 +0x579 fp=0xc01a099890 sp=0xc01a099808 pc=0x411189
github.com/influxdata/influxdb/storage/reads.(*tagsCache).Release(0xc02bcc6ed0)
/go/src/github.com/influxdata/influxdb/storage/reads/flux_tags_cache.go:209 +0x9f fp=0xc01a099918 sp=0xc01a099890 pc=0xf1ab0f
github.com/influxdata/influxdb/storage/reads.(*groupIterator).handleRead.func1(0xc01a099bc8, 0xc01a099be8, 0xc01a099bd8, 0x25332c0, 0xc03fdca000, 0xc00a812bb0)
/go/src/github.com/influxdata/influxdb/storage/reads/flux_reader.go:297 +0x7d fp=0xc01a099930 sp=0xc01a099918 pc=0xf222ed
github.com/influxdata/influxdb/storage/reads.(*groupIterator).handleRead(0xc00a812bb0, 0xc01f8f6ca0, 0x25332c0, 0xc03fdca000, 0x0, 0x0)
/go/src/github.com/influxdata/influxdb/storage/reads/flux_reader.go:363 +0x709 fp=0xc01a099c68 sp=0xc01a099930 pc=0xf0f9f9
github.com/influxdata/influxdb/storage/reads.(*groupIterator).Do(0xc00a812bb0, 0xc01f8f6ca0, 0xc00c5f5501, 0xc00a812bb0)
/go/src/github.com/influxdata/influxdb/storage/reads/flux_reader.go:275 +0x1f8 fp=0xc01a099cf8 sp=0xc01a099c68 pc=0xf0f0c8
github.com/influxdata/influxdb/flux/stdlib/influxdata/influxdb.(*Source).processTables(0xc0046528f0, 0x25420c0, 0xc09f832750, 0x2524e20, 0xc00a812bb0, 0x167a1ee81ec4c677, 0x7, 0x1670e97f1782c677)
/go/src/github.com/influxdata/influxdb/flux/stdlib/influxdata/influxdb/source.go:56 +0x94 fp=0xc01a099d60 sp=0xc01a099cf8 pc=0xf00494
github.com/influxdata/influxdb/flux/stdlib/influxdata/influxdb.(*readGroupSource).run(0xc0046528f0, 0x25420c0, 0xc09f832750, 0xc00545c000, 0x7fde207ff1f0)
/go/src/github.com/influxdata/influxdb/flux/stdlib/influxdata/influxdb/source.go:198 +0x160 fp=0xc01a099e88 sp=0xc01a099d60 pc=0xf013b0
github.com/influxdata/influxdb/flux/stdlib/influxdata/influxdb.(*Source).Run(0xc0046528f0, 0x25420c0, 0xc09f832750)
/go/src/github.com/influxdata/influxdb/flux/stdlib/influxdata/influxdb/source.go:38 +0x4f fp=0xc01a099ef8 sp=0xc01a099e88 pc=0xf0008f
github.com/influxdata/influxdb/vendor/github.com/influxdata/flux/execute.(*executionState).do.func1(0xc01265a1c0, 0xc02c94ca80, 0x25420c0, 0xc09f832750, 0x25238a0, 0xc0046528f0)
/go/src/github.com/influxdata/influxdb/vendor/github.com/influxdata/flux/execute/executor.go:275 +0xd7 fp=0xc01a099fb0 sp=0xc01a099ef8 pc=0xcca337
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc01a099fb8 sp=0xc01a099fb0 pc=0x460f61
created by github.com/influxdata/influxdb/vendor/github.com/influxdata/flux/execute.(*executionState).do
/go/src/github.com/influxdata/influxdb/vendor/github.com/influxdata/flux/execute/executor.go:250 +0xf8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting storage/reads/flux_tags_cache.go at line 209, then trace the related calls through storage/reads/flux_reader.go at lines 297 and 363. Reproduce the concurrent map iteration and map write failure if possible, identify the unsafe interaction, and verify that the reported stack trace no longer occurs.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.