siso: end the proxy's GetTree stream cleanly

The proxy's GetTree stopped reading as soon as a page came back without
a next_page_token, and returned any other Recv error to the client as
is. Both are wrong.

The backend ends the stream with io.EOF after the last page. When that
page still carries a next_page_token, which tells the client to ask for
the next page in a new call, the proxy kept reading, got io.EOF and
returned it from the handler. gRPC turns that into an Unknown "EOF"
error for the client. An empty tree fails the same way, because the
backend EOFs without sending a page. When the last page had no token,
the proxy returned while the upstream stream was still open, so gRPC
canceled it and the backend recorded a successful GetTree as canceled.

Forward pages until io.EOF instead. The page token needs no special
handling: it rides along on the last page, and the client issues its own
follow-up call.

Change-Id: I8f4c0d21a5e6b3d7c9a1f2e4b6d8a0c3e5f7b9d1
Reviewed-on: https://chromium-review.googlesource.com/c/build/+/8114150
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Philipp Wollermann <philwo@google.com>
2 files changed
tree: 30b6667f36bdf15e211deb2b425c8337c4df96ed
  1. bench/
  2. gong/
  3. hashigo/
  4. infra/
  5. kajiya/
  6. kzipinfo/
  7. remote-apis/
  8. runmc/
  9. siso/
  10. .gitignore
  11. .golangci.yml
  12. .style.yapf
  13. BUILD_OWNERS
  14. BUILD_TEAM_OWNERS
  15. CONTRIBUTING.md
  16. LICENSE
  17. OWNERS
  18. PRESUBMIT.py
  19. README.md
  20. WATCHLISTS
README.md

build.git repository

This repository contains tools developed and owned by the Chrome Build Team.

Quick start

The steps for getting the code are:

  1. Install depot_tools
  2. Run git clone https://chromium.googlesource.com/build

We use the standard Go module workflow to work on our projects.

Links