Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

tcmu panic while torusd restarted #330

Open
vtolstov opened this issue Sep 22, 2016 · 1 comment
Open

tcmu panic while torusd restarted #330

vtolstov opened this issue Sep 22, 2016 · 1 comment

Comments

@vtolstov
Copy link

I ran torusd in local node
and try to use tcmu for one volume
After torusd restarted i'm try to exit from torusblk tcmu, but have error:

panic: close of closed channel

goroutine 73 [running]:
main.tcmuAction.func1(0xc82025a360, 0xc82025a4e0)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/cmd/torusblk/tcmu.go:44 +0x14a
created by main.tcmuAction
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/cmd/torusblk/tcmu.go:46 +0x16f

goroutine 1 [select]:
github.com/coreos/torus/vendor/github.com/coreos/go-tcmu.remove(0xc825e3a320, 0x4e, 0x0, 0x0)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/vendor/github.com/coreos/go-tcmu/device.go:371 +0x2a7
github.com/coreos/torus/vendor/github.com/coreos/go-tcmu.(*Device).teardown(0xc820216b00, 0x0, 0x0)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/vendor/github.com/coreos/go-tcmu/device.go:341 +0x531
github.com/coreos/torus/vendor/github.com/coreos/go-tcmu.(*Device).Close(0xc820216b00, 0x0, 0x0)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/vendor/github.com/coreos/go-tcmu/device.go:81 +0x2d
github.com/coreos/torus/internal/tcmu.ConnectAndServe(0xc8202726a0, 0x7ffe8cb575aa, 0x5, 0xc82025a4e0, 0x0, 0x0)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/internal/tcmu/connect.go:53 +0x534
main.tcmuAction(0x1206540, 0xc8201e7db0, 0x1, 0x1)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/cmd/torusblk/tcmu.go:64 +0x550
github.com/coreos/torus/vendor/github.com/spf13/cobra.(*Command).execute(0x1206540, 0xc8201e7d40, 0x1, 0x1, 0x0, 0x0)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/vendor/github.com/spf13/cobra/command.go:565 +0x869
github.com/coreos/torus/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1205d40, 0x1206540, 0x0, 0x0)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/vendor/github.com/spf13/cobra/command.go:651 +0x56b
github.com/coreos/torus/vendor/github.com/spf13/cobra.(*Command).Execute(0x1205d40, 0x0, 0x0)
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/vendor/github.com/spf13/cobra/command.go:610 +0x2d
main.main()
        /root/rpmbuild/BUILD/torus-4d22ad33bbf50b093da2ca83bcd0fc3650618535/src/github.com/coreos/torus/cmd/torusblk/main.go:107 +0x38

goroutine 17 [syscall, 10 minutes, locked to thread]:
runtime.goexit()
        /usr/lib/golang/src/runtime/asm_amd64.s:1721 +0x1
@nak3
Copy link
Contributor

nak3 commented Sep 24, 2016

Is this reproducible? I tested on my env(Version: b6f7aba), but it worked without error. I would appreciate it if you could share the procedure. FYI: below is my test steps which couldn't reproduce.

1. Start torusd
[vagrant@torus2 torus]$ ./bin/torusd  --peer-address http://192.168.121.67:40001 --data-dir /tmp/torus1 --size 20GiB --auto-join 
...
2. Start torusblk tcmu
[vagrant@torus2 torus]$ sudo ./bin/torusblk tcmu test1 --debug
2016-09-24 09:36:01.977879 I | torus: creating metadata service: etcd
...
2016-09-24 09:36:01.981933 D | gc: creating blockvol gc
go-tcmu attached to /dev/torus/test1
3. Use volume and umount
[root@torus2 vagrant]# mkfs.ext4 /dev/torus/test1
mke2fs 1.42.13 (17-May-2015)
...
Writing superblocks and filesystem accounting information: done 
[root@torus2 vagrant]# mkdir /test
[root@torus2 vagrant]# mount /dev/torus/test1 /test
[root@torus2 vagrant]# touch /test/foo
[root@torus2 vagrant]# umount /test
4. Restart torusd
^C
Received an interrupt, stopping services...
[vagrant@torus2 torus]$ ./bin/torusd  --peer-address http://192.168.121.67:40001 --data-dir /tmp/torus1 --size 20GiB --auto-join 
2016-09-24 09:37:00.300816 I | torus: creating metadata service: etcd
...
5. Stop torusblk (and restart)
^C
Received an interrupt, disconnecting...
2016-09-24 09:54:36.756212 D | tcmu: syncing

[vagrant@torus2 torus]$ sudo ./bin/torusblk tcmu test1 --debug
...
go-tcmu attached to /dev/torus/test1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants