go-ego / riot

Go Open Source, Distributed, Simple and efficient Search Engine; Warning: This is V1 and beta version, because of big memory consume, and the V2 will be rewrite all code.
Apache License 2.0
6.11k stars 473 forks source link

[Bug] DATA RACE while using storage. #31

Closed szyhf closed 6 years ago

szyhf commented 6 years ago

Description

While using go build -race and running with storage:

2018/01/24 16:24:53 Load the gse dictionary ../../data/dict/dictionary.txt
2018/01/24 16:25:15 gse dictionary loaded finished.
==================
WARNING: DATA RACE
Read at 0x000004b4c8c0 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:656 +0x78
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Previous write at 0x000004b4c8c0 by goroutine 162:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:52 +0x1a2

Goroutine 162 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000004b4c8c0 by goroutine 82:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:52 +0x1a2

Previous read at 0x000004b4c8c0 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:656 +0x78
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 82 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000004b4c8c0 by goroutine 162:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:52 +0x1a2

Previous read at 0x000004b4c8c0 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:656 +0x78
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 162 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000004b4c8f8 by goroutine 309:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).storageIndexDocWorker()
      /go/src/github.com/go-ego/riot/storage_worker.go:52 +0x43e

Previous read at 0x000004b4c8f8 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:658 +0x138
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 309 (running) created at:
  github.com/go-ego/riot.(*Engine).Storage()
      /go/src/github.com/go-ego/riot/engine.go:216 +0xbb3
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:289 +0x8df
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000004b4c8d0 by goroutine 42:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:55 +0x159

Previous read at 0x000004b4c8d0 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:667 +0x21a
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 42 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000004b4c8d0 by goroutine 22:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:55 +0x159

Previous read at 0x000004b4c8d0 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:667 +0x21a
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 22 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000004b4c8d0 by goroutine 122:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:55 +0x159

Previous read at 0x000004b4c8d0 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:667 +0x21a
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 122 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000004b4c8d0 by goroutine 82:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:55 +0x159

Previous read at 0x000004b4c8d0 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:667 +0x21a
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 82 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000004b4c8d0 by goroutine 102:
  sync/atomic.AddInt64()
      /usr/local/go/src/runtime/race_amd64.s:276 +0xb
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:55 +0x159

Previous read at 0x000004b4c8d0 by main goroutine:
  github.com/go-ego/riot.(*Engine).FlushIndex()
      /go/src/github.com/go-ego/riot/engine.go:667 +0x21a
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:60 +0x378
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 102 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
2018/01/24 16:25:20 recover index number: 3
==================
WARNING: DATA RACE
Read at 0x00c420087f28 by goroutine 86:
  github.com/go-ego/riot/core.(*Indexer).Lookup()
      /go/src/github.com/go-ego/riot/core/indexer.go:333 +0xbc
  github.com/go-ego/riot.(*Engine).indexerLookupWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:82 +0x8d8

Previous write at 0x00c420087f28 by goroutine 82:
  github.com/go-ego/riot/core.(*Indexer).AddDocs()
      /go/src/github.com/go-ego/riot/core/indexer.go:220 +0x133f
  github.com/go-ego/riot/core.(*Indexer).AddDocToCache()
      /go/src/github.com/go-ego/riot/core/indexer.go:147 +0x8bc
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:48 +0x127

Goroutine 86 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:281 +0x774
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 82 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
==================
WARNING: DATA RACE
Read at 0x00c420088268 by goroutine 166:
  github.com/go-ego/riot/core.(*Indexer).Lookup()
      /go/src/github.com/go-ego/riot/core/indexer.go:333 +0xbc
  github.com/go-ego/riot.(*Engine).indexerLookupWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:82 +0x8d8

Previous write at 0x00c420088268 by goroutine 162:
  github.com/go-ego/riot/core.(*Indexer).AddDocs()
      /go/src/github.com/go-ego/riot/core/indexer.go:220 +0x133f
  github.com/go-ego/riot/core.(*Indexer).AddDocToCache()
      /go/src/github.com/go-ego/riot/core/indexer.go:147 +0x8bc
  github.com/go-ego/riot.(*Engine).indexerAddDocWorker()
      /go/src/github.com/go-ego/riot/indexer_worker.go:48 +0x127

Goroutine 166 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:281 +0x774
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47

Goroutine 162 (running) created at:
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:275 +0x831
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).Read()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:93 +0x64e
  github.com/go-ego/riot/vendor/github.com/go-ego/gse.(*Segmenter).LoadDict()
      /go/src/github.com/go-ego/riot/vendor/github.com/go-ego/gse/segmenter.go:272 +0x35d
  github.com/go-ego/riot.(*Engine).Init()
      /go/src/github.com/go-ego/riot/engine.go:237 +0x9d2
  main.initEngine()
      /go/src/github.com/go-ego/riot/examples/store/main.go:34 +0x151
  main.main()
      /go/src/github.com/go-ego/riot/examples/store/main.go:89 +0x47
==================
search--------- {[google testing] [{3 Google is testing another Search results layout with
        rounded cards, new colors, and the 4 mysterious colored dots again <nil> <nil> [0] [] []}] false 1} ; docs= [{3 Google is testing another Search results layout with
        rounded cards, new colors, and the 4 mysterious colored dots again <nil> <nil> [0] [] []}]
Found 11 data race(s)
vcaesar commented 6 years ago

I will test or update it.

szyhf commented 6 years ago

Thanks a lot, I've check it but I'm not sure if just add lock is properly, I think some of data race can solve by sync.WaitGroup or chanel

vcaesar commented 6 years ago

The current latest version does not appear the problem, please update. I am running in the mac, if the problem still exists in other platforms please tell me.

szyhf commented 6 years ago

@vcaesar Thanks for trying, but the error still occur.

I've upload some image. qq20180207-074846 qq20180207-074815 qq20180207-074739 qq20180207-074716