Code Monkey home page Code Monkey logo

Comments (4)

PualCN avatar PualCN commented on July 22, 2024

同问,不清楚什么原因,看系统资源还有空余

from yulong-hids-archived.

tianld11 avatar tianld11 commented on July 22, 2024

求解决办法~

from yulong-hids-archived.

zntim avatar zntim commented on July 22, 2024

求解决办法〜

临时解决方法,可以先写个脚本定时查看是否进程存在,不存在的话重启server端;

from yulong-hids-archived.

medasz avatar medasz commented on July 22, 2024

我用竞态检测的结果是这样的

WARNING: DATA RACE
Read at 0x00c0004394d0 by goroutine 36:
reflect.maplen()
/usr/lib/golang/src/runtime/map.go:1351 +0x0
reflect.Value.MapKeys()
/usr/lib/golang/src/reflect/value.go:1212 +0x3a4
encoding/json.mapEncoder.encode()
/usr/lib/golang/src/encoding/json/encode.go:785 +0x10f
encoding/json.mapEncoder.encode-fm()
/usr/lib/golang/src/encoding/json/encode.go:777 +0x84
encoding/json.structEncoder.encode()
/usr/lib/golang/src/encoding/json/encode.go:759 +0x3c4
encoding/json.structEncoder.encode-fm()
/usr/lib/golang/src/encoding/json/encode.go:730 +0xa4
encoding/json.(*encodeState).reflectValue()
/usr/lib/golang/src/encoding/json/encode.go:358 +0x93
encoding/json.(*encodeState).marshal()
/usr/lib/golang/src/encoding/json/encode.go:330 +0xd2
encoding/json.Marshal()
/usr/lib/golang/src/encoding/json/encode.go:161 +0x78
github.com/olivere/elastic.(*BulkIndexRequest).Source()
/root/go/pkg/mod/github.com/olivere/[email protected]+incompatible/bulk_index_request.go:240 +0x63e
github.com/olivere/elastic.(*bulkWorker).work()
/root/go/pkg/mod/github.com/olivere/[email protected]+incompatible/bulk_processor.go:484 +0x21e

Previous write at 0x00c0004394d0 by goroutine 57:
runtime.mapassign_faststr()
/usr/lib/golang/src/runtime/map_faststr.go:202 +0x0
yulong-hids/server/action.ResultStat()
/root/yulong-hids/server/action/statistics.go:32 +0x159e
main.(*Watcher).PutInfo()
/root/yulong-hids/server/server.go:44 +0x357
runtime.call64()
/usr/lib/golang/src/runtime/asm_amd64.s:541 +0x3d
reflect.Value.Call()
/usr/lib/golang/src/reflect/value.go:336 +0xd8
github.com/smallnest/rpcx/server.(*service).call()
/root/go/pkg/mod/github.com/smallnest/[email protected]/server/service.go:337 +0x292
github.com/smallnest/rpcx/server.(*Server).handleRequest()
/root/go/pkg/mod/github.com/smallnest/[email protected]/server/server.go:543 +0x1046
github.com/smallnest/rpcx/server.(*Server).serveConn.func2()
/root/go/pkg/mod/github.com/smallnest/[email protected]/server/server.go:422 +0x2e6

Goroutine 36 (running) created at:
github.com/olivere/elastic.(*BulkProcessor).Start()
/root/go/pkg/mod/github.com/olivere/[email protected]+incompatible/bulk_processor.go:336 +0x3d2
github.com/olivere/elastic.(*BulkProcessorService).Do()
/root/go/pkg/mod/github.com/olivere/[email protected]+incompatible/bulk_processor.go:186 +0x4b7
yulong-hids/server/models.InsertThread()
/root/yulong-hids/server/models/es.go:240 +0x29e

Goroutine 57 (running) created at:
github.com/smallnest/rpcx/server.(*Server).serveConn()
/root/go/pkg/mod/github.com/smallnest/[email protected]/server/server.go:403 +0x524

==================
WARNING: DATA RACE
Read at 0x00c0004640b8 by goroutine 36:
reflect.typedmemmove()
/usr/lib/golang/src/runtime/mbarrier.go:177 +0x0
reflect.copyVal()
/usr/lib/golang/src/reflect/value.go:1309 +0x7d
reflect.Value.MapIndex()
/usr/lib/golang/src/reflect/value.go:1195 +0x2fc
encoding/json.mapEncoder.encode()
/usr/lib/golang/src/encoding/json/encode.go:801 +0x33c
encoding/json.mapEncoder.encode-fm()
/usr/lib/golang/src/encoding/json/encode.go:777 +0x84
encoding/json.structEncoder.encode()
/usr/lib/golang/src/encoding/json/encode.go:759 +0x3c4
encoding/json.structEncoder.encode-fm()
/usr/lib/golang/src/encoding/json/encode.go:730 +0xa4
encoding/json.(*encodeState).reflectValue()
/usr/lib/golang/src/encoding/json/encode.go:358 +0x93
encoding/json.(*encodeState).marshal()
/usr/lib/golang/src/encoding/json/encode.go:330 +0xd2
encoding/json.Marshal()
/usr/lib/golang/src/encoding/json/encode.go:161 +0x78
github.com/olivere/elastic.(*BulkIndexRequest).Source()
/root/go/pkg/mod/github.com/olivere/[email protected]+incompatible/bulk_index_request.go:240 +0x63e
github.com/olivere/elastic.(*bulkWorker).work()
/root/go/pkg/mod/github.com/olivere/[email protected]+incompatible/bulk_processor.go:484 +0x21e

Previous write at 0x00c0004640b8 by goroutine 57:
yulong-hids/server/action.ResultStat()
/root/yulong-hids/server/action/statistics.go:32 +0x15b6
main.(*Watcher).PutInfo()
/root/yulong-hids/server/server.go:44 +0x357
runtime.call64()
/usr/lib/golang/src/runtime/asm_amd64.s:541 +0x3d
reflect.Value.Call()
/usr/lib/golang/src/reflect/value.go:336 +0xd8
github.com/smallnest/rpcx/server.(*service).call()
/root/go/pkg/mod/github.com/smallnest/[email protected]/server/service.go:337 +0x292
github.com/smallnest/rpcx/server.(*Server).handleRequest()
/root/go/pkg/mod/github.com/smallnest/[email protected]/server/server.go:543 +0x1046
github.com/smallnest/rpcx/server.(*Server).serveConn.func2()
/root/go/pkg/mod/github.com/smallnest/[email protected]/server/server.go:422 +0x2e6

##异步写入线程
Goroutine 36 (running) created at:
github.com/olivere/elastic.(*BulkProcessor).Start()
/root/go/pkg/mod/github.com/olivere/[email protected]+incompatible/bulk_processor.go:336 +0x3d2
github.com/olivere/elastic.(*BulkProcessorService).Do()
/root/go/pkg/mod/github.com/olivere/[email protected]+incompatible/bulk_processor.go:186 +0x4b7
yulong-hids/server/models.InsertThread()
/root/yulong-hids/server/models/es.go:240 +0x29e

Goroutine 57 (running) created at:
github.com/smallnest/rpcx/server.(*Server).serveConn()
/root/go/pkg/mod/github.com/smallnest/[email protected]/server/server.go:403 +0x524

==================
WARNING: DATA RACE
Read at 0x0000015018b0 by goroutine 34:
yulong-hids/server/safecheck.(*Check).Rules()
/root/yulong-hids/server/safecheck/check.go:114 +0x54
yulong-hids/server/safecheck.(*Check).Run()
/root/yulong-hids/server/safecheck/check.go:274 +0x10b
yulong-hids/server/safecheck.ScanMonitorThread.func1()
/root/yulong-hids/server/safecheck/check.go:290 +0x3e4

Previous write at 0x0000015018b0 by goroutine 21:
reflect.typedmemmove()
/usr/lib/golang/src/runtime/mbarrier.go:177 +0x0
reflect.Value.Set()
/usr/lib/golang/src/reflect/value.go:1556 +0x108
gopkg.in/mgo%2ev2.(*Iter).All()
/root/go/pkg/mod/gopkg.in/[email protected]/session.go:3812 +0x497
gopkg.in/mgo%2ev2.(*Query).All()
/root/go/pkg/mod/gopkg.in/[email protected]/session.go:3818 +0x5e
yulong-hids/server/models.setRules()
/root/yulong-hids/server/models/common.go:176 +0x1ca
yulong-hids/server/models.Heartbeat()
/root/yulong-hids/server/models/common.go:195 +0x84

Goroutine 34 (running) created at:
yulong-hids/server/safecheck.ScanMonitorThread()
/root/yulong-hids/server/safecheck/check.go:284 +0x8f

Goroutine 21 (running) created at:
main.init.0()
/root/yulong-hids/server/server.go:66 +0x186

==================
WARNING: DATA RACE
Write at 0x000001512cc8 by goroutine 21:
yulong-hids/server/models.setConfig()
/root/yulong-hids/server/models/common.go:166 +0x74c
yulong-hids/server/models.Heartbeat()
/root/yulong-hids/server/models/common.go:194 +0x7d

Previous read at 0x000001512cc8 by goroutine 34:
yulong-hids/server/safecheck.(*Check).Intelligence()
/root/yulong-hids/server/safecheck/check.go:191 +0x54
yulong-hids/server/safecheck.(*Check).Run()
/root/yulong-hids/server/safecheck/check.go:275 +0x119
yulong-hids/server/safecheck.ScanMonitorThread.func1()
/root/yulong-hids/server/safecheck/check.go:290 +0x3e4

Goroutine 21 (running) created at:
main.init.0()
/root/yulong-hids/server/server.go:66 +0x186

Goroutine 34 (running) created at:
yulong-hids/server/safecheck.ScanMonitorThread()
/root/yulong-hids/server/safecheck/check.go:284 +0x8f

==================
WARNING: DATA RACE
Write at 0x00c0001e4270 by goroutine 21:
reflect.typedmemmove()
/usr/lib/golang/src/runtime/mbarrier.go:177 +0x0
reflect.Value.Set()
/usr/lib/golang/src/reflect/value.go:1556 +0x108
gopkg.in/mgo.v2/bson.(*decoder).readDocTo()
/root/go/pkg/mod/gopkg.in/[email protected]/bson/decode.go:202 +0x624
gopkg.in/mgo.v2/bson.Unmarshal()
/root/go/pkg/mod/gopkg.in/[email protected]/bson/bson.go:559 +0x238
gopkg.in/mgo%2ev2.(*Iter).Next()
/root/go/pkg/mod/gopkg.in/[email protected]/session.go:3732 +0x6b0
gopkg.in/mgo%2ev2.(*Iter).All()
/root/go/pkg/mod/gopkg.in/[email protected]/session.go:3806 +0x590
gopkg.in/mgo%2ev2.(*Query).All()
/root/go/pkg/mod/gopkg.in/[email protected]/session.go:3818 +0x5e
yulong-hids/server/models.setRules()
/root/yulong-hids/server/models/common.go:176 +0x1ca
yulong-hids/server/models.Heartbeat()
/root/yulong-hids/server/models/common.go:195 +0x84

Previous read at 0x00c0001e4270 by goroutine 24:
yulong-hids/server/safecheck.(*Check).Rules()
/root/yulong-hids/server/safecheck/check.go:114 +0xab
yulong-hids/server/safecheck.(*Check).Run()
/root/yulong-hids/server/safecheck/check.go:274 +0x10b
yulong-hids/server/safecheck.ScanMonitorThread.func1()
/root/yulong-hids/server/safecheck/check.go:290 +0x3e4

Goroutine 21 (running) created at:
main.init.0()
/root/yulong-hids/server/server.go:66 +0x186

Goroutine 24 (running) created at:
yulong-hids/server/safecheck.ScanMonitorThread()
/root/yulong-hids/server/safecheck/check.go:284 +0x8f

==================
WARNING: DATA RACE
Write at 0x000001512c30 by goroutine 21:
yulong-hids/server/models.setConfig()
/root/yulong-hids/server/models/common.go:166 +0x74c
yulong-hids/server/models.Heartbeat()
/root/yulong-hids/server/models/common.go:194 +0x7d

Previous read at 0x000001512c30 by goroutine 34:
yulong-hids/server/safecheck.(*Check).BlackFilter()
/root/yulong-hids/server/safecheck/check.go:66 +0xa5
yulong-hids/server/safecheck.(*Check).Run()
/root/yulong-hids/server/safecheck/check.go:270 +0xe4
yulong-hids/server/safecheck.ScanMonitorThread.func1()
/root/yulong-hids/server/safecheck/check.go:290 +0x3e4

Goroutine 21 (running) created at:
main.init.0()
/root/yulong-hids/server/server.go:66 +0x186

Goroutine 34 (running) created at:
yulong-hids/server/safecheck.ScanMonitorThread()
/root/yulong-hids/server/safecheck/check.go:284 +0x8f

==================
WARNING: DATA RACE
Write at 0x000001512c90 by goroutine 21:
yulong-hids/server/models.setConfig()
/root/yulong-hids/server/models/common.go:166 +0x74c
yulong-hids/server/models.Heartbeat()
/root/yulong-hids/server/models/common.go:194 +0x7d

Previous read at 0x000001512c90 by goroutine 34:
yulong-hids/server/safecheck.(*Check).WhiteFilter()
/root/yulong-hids/server/safecheck/check.go:103 +0xa5
yulong-hids/server/safecheck.(*Check).Run()
/root/yulong-hids/server/safecheck/check.go:271 +0xf2
yulong-hids/server/safecheck.ScanMonitorThread.func1()
/root/yulong-hids/server/safecheck/check.go:290 +0x3e4

Goroutine 21 (running) created at:
main.init.0()
/root/yulong-hids/server/server.go:66 +0x186

Goroutine 34 (running) created at:
yulong-hids/server/safecheck.ScanMonitorThread()
/root/yulong-hids/server/safecheck/check.go:284 +0x8f

from yulong-hids-archived.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.