Skip to content
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

Remove remaining non-hierarchical locking in the rpc package. #406

Merged
merged 8 commits into from
Dec 29, 2022

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Dec 28, 2022

Builds on #403, which should be merged first.

This removes all remaining unlock uses that aren't either:

Lock()
defer Unlock()

or syncutil.With.

Giving this a name makes it easier to follow what's going on here.
I don't love this, but at least it gets us to a place where the locking
is reasonably simple.
Per Louis's suggestion
This is the last place in the rpc package where we're unlocking c.lk,
and it isn't either:

- using synctuil.With()
- in a defer statement, immediately after the Lock().
@lthibault
Copy link
Collaborator

ok  	capnproto.org/go/capnp/v3/rpc	1.201s
panic: close of closed channel

goroutine 200 [running]:
capnproto.org/go/capnp/v3.Client.Release({0x9856870})
	/home/runner/work/go-capnproto2/go-capnproto2/capability.go:587 +0xe6
capnproto.org/go/capnp/v3.(*Message).Reset(0x993e120, {0x0, 0x0})
	/home/runner/work/go-capnproto2/go-capnproto2/message.go:139 +0xc6
capnproto.org/go/capnp/v3/rpc/transport.(*transport).RecvMessage.func1()
	/home/runner/work/go-capnproto2/go-capnproto2/rpc/transport/transport.go:171 +0x3b
capnproto.org/go/capnp/v3/rpc.(*Conn).handleReturn.func2()
	/home/runner/work/go-capnproto2/go-capnproto2/rpc/rpc.go:1008 +0xd3
created by capnproto.org/go/capnp/v3/rpc.(*Conn).handleReturn
	/home/runner/work/go-capnproto2/go-capnproto2/rpc/rpc.go:1001 +0x7e5
exit status 2
FAIL	capnproto.org/go/capnp/v3/rpc	0.822s

I think this is a new one.

@zenhack
Copy link
Contributor Author

zenhack commented Dec 28, 2022

That looks like #348

@zenhack zenhack merged commit 953da2c into capnproto:main Dec 29, 2022
@zenhack zenhack deleted the nh-locking branch December 29, 2022 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants