-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context based cancellation #106
Comments
This also needs #23. |
Implemented in 91437d0, let me know if more work is needed here. |
@lukechampine Thanks for that update. Unfortunately, it looks like there are bugs and fatal error: checkptr: converted pointer straddles multiple allocations
goroutine 3102 [running]:
runtime.throw(0x15ad5f6, 0x3a)
/usr/local/Cellar/go/1.15.2/libexec/src/runtime/panic.go:1116 +0x72 fp=0xc004e250d0 sp=0xc004e250a0 pc=0x10794f2
runtime.checkptrAlignment(0xc00071bb90, 0x1566da0, 0x1)
/usr/local/Cellar/go/1.15.2/libexec/src/runtime/checkptr.go:20 +0xc9 fp=0xc004e25100 sp=0xc004e250d0 pc=0x1049329
gitlab.com/NebulousLabs/bolt.(*Bucket).write(0xc004e25270, 0x0, 0x0, 0x0)
/Users/junpei/pkg/mod/gitlab.com/!nebulous!labs/bolt@v1.4.0/bucket.go:624 +0x15f fp=0xc004e25168 sp=0xc004e25100 pc=0x1330b7f
gitlab.com/NebulousLabs/bolt.(*Bucket).CreateBucket(0xc001cf8018, 0x1c02718, 0x5, 0x5, 0x10b3f8c, 0x10c93bf, 0xc001cf01a0)
/Users/junpei/pkg/mod/gitlab.com/!nebulous!labs/bolt@v1.4.0/bucket.go:181 +0x32d fp=0xc004e25320 sp=0xc004e25168 pc=0x132de8d
gitlab.com/NebulousLabs/bolt.(*Bucket).CreateBucketIfNotExists(0xc001cf8018, 0x1c02718, 0x5, 0x5, 0x0, 0xc004e25f08, 0x0)
/Users/junpei/pkg/mod/gitlab.com/!nebulous!labs/bolt@v1.4.0/bucket.go:199 +0x5e fp=0xc004e25388 sp=0xc004e25320 pc=0x132e31e
gitlab.com/NebulousLabs/bolt.(*Tx).CreateBucketIfNotExists(...)
/Users/junpei/pkg/mod/gitlab.com/!nebulous!labs/bolt@v1.4.0/tx.go:115
lukechampine.com/us/renter/renterutil.NewBoltMetaDB.func1(0xc001cf8000, 0xc00011dc01, 0xc001cf8000)
/Users/junpei/src/github.com/lukechampine/us/renter/renterutil/metadb.go:393 +0x1bb fp=0xc004e25450 sp=0xc004e25388 pc=0x14e05db
gitlab.com/NebulousLabs/bolt.(*DB).Update(0xc001cf0000, 0x15b56b0, 0x0, 0x0)
/Users/junpei/pkg/mod/gitlab.com/!nebulous!labs/bolt@v1.4.0/db.go:677 +0xf1 fp=0xc004e254f8 sp=0xc004e25450 pc=0x13394d1
lukechampine.com/us/renter/renterutil.NewBoltMetaDB(0xc001cd82d0, 0x4c, 0x2, 0xc001cd82d0, 0x4c)
/Users/junpei/src/github.com/lukechampine/us/renter/renterutil/metadb.go:386 +0x10b fp=0xc004e25590 sp=0xc004e254f8 pc=0x14b67cb
lukechampine.com/us/renter/renterutil.createTestingKV(0x162aa40, 0xc0003d6300, 0x2, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/junpei/src/github.com/lukechampine/us/renter/renterutil/kv_test.go:48 +0xee5 fp=0xc004e25b80 sp=0xc004e25590 pc=0x14ce185
lukechampine.com/us/renter/renterutil.TestKVPutGet(0xc0003d6300)
/Users/junpei/src/github.com/lukechampine/us/renter/renterutil/kv_test.go:73 +0x94 fp=0xc004e25ed0 sp=0xc004e25b80 pc=0x14ce514
testing.tRunner(0xc0003d6300, 0x15b5788)
/usr/local/Cellar/go/1.15.2/libexec/src/testing/testing.go:1127 +0x203 fp=0xc004e25fd0 sp=0xc004e25ed0 pc=0x11b44e3
runtime.goexit()
/usr/local/Cellar/go/1.15.2/libexec/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc004e25fd8 sp=0xc004e25fd0 pc=0x10b24a1
created by testing.(*T).Run
/usr/local/Cellar/go/1.15.2/libexec/src/testing/testing.go:1178 +0x797
goroutine 1 [chan receive]:
testing.(*T).Run(0xc000106480, 0x159c0bb, 0xc, 0x15b5788, 0x1)
/usr/local/Cellar/go/1.15.2/libexec/src/testing/testing.go:1179 +0x7cf
testing.runTests.func1(0xc000106480)
/usr/local/Cellar/go/1.15.2/libexec/src/testing/testing.go:1449 +0xa7
testing.tRunner(0xc000106480, 0xc00016fcc8)
/usr/local/Cellar/go/1.15.2/libexec/src/testing/testing.go:1127 +0x203
testing.runTests(0xc00012cae0, 0x1c63280, 0x14, 0x14, 0xbfd8717dccf736c0, 0x8bb2fd00fe, 0x1c72000, 0xc000158980)
/usr/local/Cellar/go/1.15.2/libexec/src/testing/testing.go:1447 +0x5ab
testing.(*M).Run(0xc0001be080, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/testing/testing.go:1357 +0x4ec
main.main()
_testmain.go:95 +0x237
goroutine 3948 [IO wait]:
internal/poll.runtime_pollWait(0xa32de38, 0x72, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/runtime/netpoll.go:220 +0x55
internal/poll.(*pollDesc).wait(0xc0002e6218, 0x72, 0x0, 0x0, 0x1598888)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_poll_runtime.go:87 +0xe6
internal/poll.(*pollDesc).waitRead(...)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0002e6200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_unix.go:394 +0x2fe
net.(*netFD).accept(0xc0002e6200, 0x37e11d600, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/net/fd_unix.go:172 +0x58
net.(*TCPListener).accept(0xc004d19ae0, 0xc00011dc18, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/net/tcpsock_posix.go:139 +0x50
net.(*TCPListener).Accept(0xc004d19ae0, 0x15b55d8, 0xc0007b4280, 0x1629660, 0xc00011dc18)
/usr/local/Cellar/go/1.15.2/libexec/src/net/tcpsock.go:261 +0x8e
lukechampine.com/us/internal/ghost.(*Host).listen(0xc0007b4280, 0xc0001783a0, 0x20)
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/host.go:54 +0x88
created by lukechampine.com/us/internal/ghost.New
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/host.go:83 +0x2d1
goroutine 3951 [IO wait]:
internal/poll.runtime_pollWait(0xa32dc78, 0x72, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/runtime/netpoll.go:220 +0x55
internal/poll.(*pollDesc).wait(0xc0002e6618, 0x72, 0x0, 0x0, 0x1598888)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_poll_runtime.go:87 +0xe6
internal/poll.(*pollDesc).waitRead(...)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0002e6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_unix.go:394 +0x2fe
net.(*netFD).accept(0xc0002e6600, 0x37e11d600, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/net/fd_unix.go:172 +0x58
net.(*TCPListener).accept(0xc004d19ce0, 0xc004c67890, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/net/tcpsock_posix.go:139 +0x50
net.(*TCPListener).Accept(0xc004d19ce0, 0x15b55d8, 0xc0007b4550, 0x1629660, 0xc004c67890)
/usr/local/Cellar/go/1.15.2/libexec/src/net/tcpsock.go:261 +0x8e
lukechampine.com/us/internal/ghost.(*Host).listen(0xc0007b4550, 0xc000178520, 0x20)
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/host.go:54 +0x88
created by lukechampine.com/us/internal/ghost.New
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/host.go:83 +0x2d1
goroutine 3970 [IO wait]:
internal/poll.runtime_pollWait(0xa32d9d8, 0x72, 0x1622840)
/usr/local/Cellar/go/1.15.2/libexec/src/runtime/netpoll.go:220 +0x55
internal/poll.(*pollDesc).wait(0xc0002e6798, 0x72, 0xc001cec000, 0x8, 0x1bf8)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_poll_runtime.go:87 +0xe6
internal/poll.(*pollDesc).waitRead(...)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0002e6780, 0xc001cec000, 0x8, 0x1bf8, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_unix.go:159 +0x24f
net.(*netFD).Read(0xc0002e6780, 0xc001cec000, 0x8, 0x1bf8, 0xc0000f66f8, 0xc0000f8408, 0xc0000f8400)
/usr/local/Cellar/go/1.15.2/libexec/src/net/fd_posix.go:55 +0x66
net.(*conn).Read(0xc004c67890, 0xc001cec000, 0x8, 0x1bf8, 0x10b3b62, 0x119887f, 0xc00009c138)
/usr/local/Cellar/go/1.15.2/libexec/src/net/net.go:182 +0xec
io.(*LimitedReader).Read(0xc00009c160, 0xc001cec000, 0x8, 0x1bf8, 0x0, 0x37659ad718625b5e, 0x4e41547c75badb94)
/usr/local/Cellar/go/1.15.2/libexec/src/io/io.go:455 +0xc8
bytes.(*Buffer).ReadFrom(0xc00009c138, 0x1621a80, 0xc00009c160, 0xc002a4f998, 0xb2c0554, 0xc000052d80)
/usr/local/Cellar/go/1.15.2/libexec/src/bytes/buffer.go:204 +0x159
lukechampine.com/us/renterhost.(*objBuffer).copyN(0xc00009c138, 0xa2c5038, 0xc004c67890, 0x8, 0xc004c67890, 0xc0002e6780)
/Users/junpei/src/github.com/lukechampine/us/renterhost/encoding.go:136 +0xc5
lukechampine.com/us/renterhost.(*Session).readMessage(0xc00009c100, 0x1626860, 0xc00373af50, 0x1000, 0x15ac8db0, 0xff61d1bc)
/Users/junpei/src/github.com/lukechampine/us/renterhost/session.go:152 +0x1d3
lukechampine.com/us/renterhost.(*Session).ReadID(0xc00009c100, 0x34630b8a000, 0x0, 0x0, 0x0)
/Users/junpei/src/github.com/lukechampine/us/renterhost/session.go:194 +0x108
lukechampine.com/us/internal/ghost.(*Host).handleConn(0xc0007b4550, 0x1629660, 0xc004c67890, 0x0, 0x0)
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/session.go:56 +0x9a5
lukechampine.com/us/internal/ghost.(*Host).listen.func1(0xc0007b4550, 0x1629660, 0xc004c67890)
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/host.go:59 +0x54
created by lukechampine.com/us/internal/ghost.(*Host).listen
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/host.go:58 +0x5d
goroutine 3103 [IO wait]:
internal/poll.runtime_pollWait(0xa32dd58, 0x72, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/runtime/netpoll.go:220 +0x55
internal/poll.(*pollDesc).wait(0xc0001be318, 0x72, 0x0, 0x0, 0x1598888)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_poll_runtime.go:87 +0xe6
internal/poll.(*pollDesc).waitRead(...)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0001be300, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/internal/poll/fd_unix.go:394 +0x2fe
net.(*netFD).accept(0xc0001be300, 0x37e11d600, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/net/fd_unix.go:172 +0x58
net.(*TCPListener).accept(0xc005ea0080, 0xc00011dc10, 0x0, 0x0)
/usr/local/Cellar/go/1.15.2/libexec/src/net/tcpsock_posix.go:139 +0x50
net.(*TCPListener).Accept(0xc005ea0080, 0x15b55d8, 0xc00070c140, 0x1629660, 0xc00011dc10)
/usr/local/Cellar/go/1.15.2/libexec/src/net/tcpsock.go:261 +0x8e
lukechampine.com/us/internal/ghost.(*Host).listen(0xc00070c140, 0xc0023840a0, 0x20)
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/host.go:54 +0x88
created by lukechampine.com/us/internal/ghost.New
/Users/junpei/src/github.com/lukechampine/us/internal/ghost/host.go:83 +0x2d1 |
The latest version of |
I upgraded gitlab.com/NebulousLabs/bolt to v1.4.4 and now get these errors:
Looks like |
It looks like there are two races here:
Both of these are relatively minor fixes. |
Since we share a |
I've resolved the issue for now by adding contract locks and only listening for |
I just realized us/renter/renterutil/strategies.go Lines 767 to 770 in dc4b3df
To avoid this, maybe |
In PseudoFS, the user should be responsible for cancellation because the user could cancel writing contents to PseudoFile. However, in PseudoKV, currently, there is no way to cancel uploading/downloading. We can, for example, close the reader that is passed to Put method during upload but it still doesn't stop actual uploads. So, PseudoKV would be better to support context-based cancellation.
Related to #67.
The text was updated successfully, but these errors were encountered: