Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid using connections until they are healthy. (#498)
* Avoid using connections until they are healthy. * Change Balancer to track the set of healthy connections. * Added state machine to clientConnection. * Create clientConnection as soon as a resolver returns an address. * Do version handshake on connection before adding it to the balancer. * Removed CallOptions.Balancer (call.Connection now has one balancer). * Dropped unused Sharded balancer. * Dropped some obsolete tests. * Tweaked some tests to account for changed behavior. * Added deadlines to some tests to make them behave better when things hang due to a bug. * Undid earlier bad renaming of object to component. * Split a large test into multiple tests. We also disable the method call panic weavertest since it does not work. Explanation: if a remote weavelet paniced, it's exit raced with weavertest cleanup. If the code reading from the remote weavelet detected the broken connection before weavertest got a chance to mark the test as done, we would print an error message and exit the test process. This interacted poorly with the weavertest/internal/generate test that intentionally triggers a panic in a remote component. To elaborate on what is going wrong, if a subprocess in a weavertest panics, this code will error out: ``` weaver/weavertest/deployer.go Line 374 in c893d9a err := e.Serve(handler) ``` Which leads to stopLocked being called which cancels a context: ``` weaver/weavertest/deployer.go Line 218 in c893d9a d.ctxCancel() ``` This context is used to create all weavelets. When this context is cancelled, the pipes between all envelopes and weavelets shut down. The main weavelet detects this and self-terminates, causing the test to fail even though it should pass. ``` weaver/internal/weaver/remoteweavelet.go Line 178 in c893d9a return w.conn.Serve(w) ```
- Loading branch information