[roll] Roll fuchsia [fidl][llcpp] Async methods unbind on send errors

When a client method call encounters an error, it should lead to binding
teardown. We already do this for errors in the receiving path; this CL
extends that to cover errors in the sending path as well.

This CL started out simple but uncovered two subtle issues:

1. If the teardown is immediately initiated on any error, that could
lead to racy discarding of unread messages. The chosen behavior is to
drain all messages when the error is peer closed. The full details are
explained in a comment block in `llcpp_client_base.cc`. This would be a
good case to formalize and validate in a future dynamic binding spec
conformance test.

2. The LLCPP client supports both async and sync calls. We would like to
make the sync calls initiate teardown on errors too, but that turned out
much more tricky because the sync calls use the C++17 guaranteed return
value optimization to avoid any copies or moves of the result type. As
a result, the code performing the sync call cannot check the result of
the call because it is a pr-value built directly on the user's stack.
Furthermore, if a sync call drags out long after the client object is
destroyed, it may cause use-after-free as it tries to teardown a
non-existent client.

It's likely still possible to make sync calls in the async client
initiate teardown but that could involve more changes. This CL sets the
foundation via some refactoring.

Original-Fixed: 78989

Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/582013
Original-Revision: 79031df703b96d104443bb8b35d48eceedc46fad
GitOrigin-RevId: 97ebe033461ba58b1159ac7c3d5de0e4f39a3fce
Change-Id: Ife44321a47f115fd505dacbd35d868b1ba7bc1ba
1 file changed
tree: 614a793c65ce2acb2fd5cd6a833d64d1f6ae535a
  1. garnet/
  2. infra/
  3. peridot/
  4. third_party/
  5. topaz/
  6. zircon/
  7. firmware
  8. flower
  9. jiri.lock
  10. minimal
  11. prebuilts
  12. README.md
  13. stem
  14. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.