Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-15915

Gossip closes ledger twice, resulting in a panic at end of integration tests

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Medium
    • Resolution: Done
    • None
    • v2.0.0
    • None
    • This is reproducible on master, I assume in every integration test suite. Just run an integration test with the -v flag and you should see this at the end right before the test finishes.

    Description

      After the recent rework of ledger code via FAB-15755, at the end of integration test runs on the current master a panic occurs in ledgermgmt: 

      [e][org1.peer1] 2019-07-10 12:30:24.084 EDT [nodeCmd] handleSignals -> INFO 157 Received signal: 15 (terminated)
      [e][org1.peer1] 2019-07-10 12:30:24.084 EDT [nodeCmd] handleSignals -> INFO 157 Received signal: 15 (terminated)
      [e][org1.peer1] 2019-07-10 12:30:24.084 EDT [gossip.service] Stop -> INFO 158 Stopping chain testchannel
      [e][org1.peer1] 2019-07-10 12:30:24.084 EDT [gossip.service] Stop -> INFO 159 Stopping leader election for testchannel
      [e][org1.peer1] panic: runtime error: invalid memory address or nil pointer dereference
      [e][org1.peer1] [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x48f9a79]
      [e][org1.peer1] 
      [e][org1.peer1] goroutine 1 [running]:
      [e][org1.peer1] github.com/hyperledger/fabric/core/ledger/ledgermgmt.(*LedgerMgr).closeLedger(0xc0000c6380, 0xc00277f630, 0xb)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgermgmt/ledger_mgmt.go:168 +0x99
      [e][org1.peer1] github.com/hyperledger/fabric/core/ledger/ledgermgmt.(*closableLedger).Close(0xc002842060)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgermgmt/ledger_mgmt.go:181 +0x40
      [e][org1.peer1] github.com/hyperledger/fabric/gossip/service.privateHandler.close(0x5139700, 0xc002668f30, 0x51778a0, 0xc00261be30, 0x7e60918, 0xc0028ed200, 0x51713c0, 0xc002668f60, 0x513cee0, 0x4fcbaa0, ...)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/gossip/service/gossip_service.go:161 +0x31
      [e][org1.peer1] github.com/hyperledger/fabric/gossip/service.(*GossipService).Stop(0xc000439c20)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/gossip/service/gossip_service.go:472 +0x2c8
      [e][org1.peer1] github.com/hyperledger/fabric/internal/peer/node.serve(0x5c24628, 0x0, 0x0, 0x0, 0x0)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/internal/peer/node/start.go:707 +0x443c
      [e][org1.peer1] github.com/hyperledger/fabric/internal/peer/node.glob..func1(0x5bdeba0, 0x5c24628, 0x0, 0x0, 0x0, 0x0)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/internal/peer/node/start.go:128 +0xf1
      [e][org1.peer1] github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0x5bdeba0, 0x5c24628, 0x0, 0x0, 0x5bdeba0, 0x5c24628)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:826 +0x465
      [e][org1.peer1] github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x5bdf0a0, 0xc000385f60, 0x1, 0x1)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:914 +0x2fc
      [e][org1.peer1] github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(...)
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:864
      [e][org1.peer1] main.main()
      [e][org1.peer1]  /Users/wlahti/gopath/src/github.com/hyperledger/fabric/cmd/peer/main.go:51 +0x416 

      This is due to gossip first closing the "chain" and then the "privateHandler" for that "chain" here: https://github.com/hyperledger/fabric/blob/master/gossip/service/gossip_service.go#L471-L472

      cc: manish-sethi

      Attachments

        Issue Links

          Activity

            People

              wlahti Will Lahti
              wlahti Will Lahti
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: