rpc/stream/vif: Concurrent mgr.FindOrDialVIFs should share VIF cache.

Before this change, concurrent mgr.FindOrDialVIFs would all create
separate VIFs because they would skip passed the vifSet.Find and Dial
a VIF before the vifSet gets populated.
This was being seen in a JS test that concurrently create 22 Servers
whose attempts to mount were taking forever, even though they shared
the same client for mounting.

The solution in this CL is to introduce a vif.Set.BlockingFind that
blocks if it knows another thread is going Dial the VIF to the desired
network and address shortly.

This guarantees that only one VIF will be created per (network,address)

Note: something similar will need to be done in the vcMap in client.go
as well.

Change-Id: Iaa422467c1df132ed0902db4ccd2e7a3e7f7c24d
4 files changed
tree: 317c9a9c921b34adfca46b494e446fdb212def69
  1. cmd/
  2. envvar/
  3. examples/
  4. internal/
  5. lib/
  6. profiles/
  7. services/
  8. test/
  9. .gitignore
  10. AUTHORS
  11. CONTRIBUTORS
  12. LICENSE
  13. PATENTS
  14. README.md
  15. 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.