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

Fix #382 #391

Merged
merged 1 commit into from
Dec 16, 2022
Merged

Fix #382 #391

merged 1 commit into from
Dec 16, 2022

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Dec 16, 2022

This reworks the locking such that newPipelineCallMessage & newImportCallMessage expect the caller to already be holding the connection lock, and then removes the call to syncutil.Without in order to comply with sendMessage's contract.

There is a big downside here: it means that it is no longer OK for PlaceArgs to call into the RPC subsystem, as it could cause a deadlock.

We're planning on reworking this interface to get rid of PlaceArgs anyway (see #64), and this kind of code is not that common and generally easy to avoid, so in the interest of finishing out one batch of refactoring before starting the next, I am of the opinion that this is probably the right thing to do.


@lthibault, I want your opinion on the PlaceArgs thing.

This reworks the locking such that newPipelineCallMessage &
newImportCallMessage expect the caller to already be holding the
connection lock, and then removes the call to syncutil.Without in order
to comply with sendMessage's contract.

There is a big downside here: it means that it is no longer OK for
PlaceArgs to call into the RPC subsystem, as it could cause a deadlock.

We're planning on reworking this interface to get rid of PlaceArgs
anyway (see capnproto#64), and this kind of code is not that common and generally
easy to avoid, so in the interest of finishing out one batch of
refactoring before starting the next, I am of the opinion that this is
probably the right thing to do.
@zenhack
Copy link
Contributor Author

zenhack commented Dec 16, 2022

Failure looks like the same as in #376 (comment)

Copy link
Collaborator

@lthibault lthibault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The limitation on PlaceArgs sounds sensible. I'm not making any RPC calls inside of that callback in my code, and I suspect few people are going to try it (famous last words...).

@lthibault lthibault merged commit 2dc75f5 into capnproto:main Dec 16, 2022
@zenhack zenhack deleted the fix-382 branch December 16, 2022 19:37
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