runtime/internal/flow/conn: Fix flow control accounting when flows
close..

Previously we were sometimes loosing shared tokens when a flow closed
with borrowed tokens outstanding.  This happened in two ways:

1. When the remote end closed a flow it didn't release the counts
remaining in it's readq.
2. If the local end closes the flow with outstanding borrowed counts
then an incoming release message will not find the flow in the map and
so we'll just skip it's release and the borrowed counts will never be
returned.

This fix addresses those issues by not removing a flow from the flow map
until all its borrowed counters have been released, and by assuming that
a close flow message means the other end has erased its buffer.

Change-Id: Ic6b433890c973a6d1e6637d535aca0f52582f392
4 files changed
tree: a7f6aa8c2f9f4c2a3a5e4d41741b89e8e0bfd374
  1. cmd/
  2. examples/
  3. internal/
  4. lib/
  5. runtime/
  6. services/
  7. test/
  8. .gitignore
  9. AUTHORS
  10. CONTRIBUTING.md
  11. CONTRIBUTORS
  12. envvar.go
  13. envvar_test.go
  14. LICENSE
  15. PATENTS
  16. README.md
  17. VERSION
README.md

Vanadium

This repository contains a reference implementation of the Vanadium APIs.

Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.