Code Monkey home page Code Monkey logo

Comments (2)

whunmr avatar whunmr commented on June 25, 2024

Thanks for the detailed logs and ways to reproduce the issue.

fixing this one now.

from copernicus.

whunmr avatar whunmr commented on June 25, 2024
  • reproduced before fix
| => coperctl --notls  -s 127.0.0.1:18334 gettxoutsetinfo
==================
WARNING: DATA RACE
Read at 0x00c0001e98c0 by goroutine 81:
  github.com/copernet/copernicus/persist/disk.FlushStateToDisk()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/persist/disk/disk.go:397 +0xd1b
  github.com/copernet/copernicus/rpc.handleGetTxoutSetInfo()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/rpc/rpcblockchain.go:755 +0x86
  github.com/copernet/copernicus/rpc.(*Server).standardCmdResult()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/rpc/rpcserver.go:217 +0x1f6
  github.com/copernet/copernicus/rpc.(*Server).jsonRPCRead()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/rpc/rpcserver.go:378 +0x1d4a
  github.com/copernet/copernicus/rpc.(*Server).Start.func1()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/rpc/rpcserver.go:448 +0x43e
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/opt/go/libexec/src/net/http/server.go:1964 +0x6f
  net/http.(*ServeMux).ServeHTTP()
      /usr/local/opt/go/libexec/src/net/http/server.go:2361 +0x2cb
  net/http.serverHandler.ServeHTTP()
      /usr/local/opt/go/libexec/src/net/http/server.go:2741 +0x34e
  net/http.(*conn).serve()
      /usr/local/opt/go/libexec/src/net/http/server.go:1847 +0x1f7b

Previous write at 0x00c0001e98c0 by goroutine 76:
  runtime.mapassign()
      /usr/local/opt/go/libexec/src/runtime/map.go:549 +0x0
  github.com/copernet/copernicus/persist.(*PersistGlobal).AddDirtyBlockIndex()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/persist/global.go:56 +0xb2
  github.com/copernet/copernicus/model/chain.(*Chain).AddToIndexMap()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/model/chain/chain.go:594 +0x969
  github.com/copernet/copernicus/logic/lblock.AcceptBlockHeader()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/logic/lblock/lblock.go:311 +0x3d3
  github.com/copernet/copernicus/service.ProcessBlockHeader()
      /Users/bj1809120051/.go/src/github.com/copernet/copernicus/service/blockservice.go:19 +0x29e
  github.com/copernet/copernicus/net/syncmanager.(*SyncManager).handleHeadersMsg()
  • tests after fix
    Tested from clean testnet env, the IBD will 1) get all headers and 2)get historical blocks.

    • test command:
    watch -d -n 5 'coperctl --notls -s 127.0.0.1:18334 gettxoutsetinfo'
    

    test logs:

       Every 5.0s: coperctl --notls -s 127.0.0.1:18334 gettxoutsetinfo                                                                                                       Tue Dec 18 13:27:01 2018
    {
      "height": 40323,
      "bestblock": "0000000025e580fdacf8b6f98f59d68333dcbae9e2a918a70eeb544aeac6351f",
      "transactions": 35537,
      "txouts": 35558,
      "bogosize": 4189250,
      "hash_serialized": "18784f0a4c52fc033864d6f2d72c26708df251799fb3af4d76fb07479882bce6",
      "disk_size": 2557176,
      "total_amount": 2016150
    }
    

from copernicus.

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.