mirror of https://github.com/grpc/grpc-go.git
Make initial service config non-blocking in Dial()
This commit is contained in:
parent
ad16b942fb
commit
a66f9231a8
|
@ -356,14 +356,13 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
|
|||
}()
|
||||
|
||||
if cc.dopts.scChan != nil {
|
||||
// Wait for the initial service config.
|
||||
// Try to get an initial service config.
|
||||
select {
|
||||
case sc, ok := <-cc.dopts.scChan:
|
||||
if ok {
|
||||
cc.sc = sc
|
||||
}
|
||||
case <-ctx.Done():
|
||||
return nil, ctx.Err()
|
||||
default:
|
||||
}
|
||||
}
|
||||
// Set defaults.
|
||||
|
|
|
@ -1450,12 +1450,12 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
wg.Wait()
|
||||
}
|
||||
|
||||
func TestMsgSizeDefaultAndApi(t *testing.T) {
|
||||
func TestMsgSizeDefaultAndAPI(t *testing.T) {
|
||||
defer leakCheck(t)()
|
||||
for _, e := range listTestEnv() {
|
||||
testMaxMsgSizeClientDefault(t, e)
|
||||
testMaxMsgSizeClientApi(t, e)
|
||||
testMaxMsgSizeServerApi(t, e)
|
||||
testMaxMsgSizeClientAPI(t, e)
|
||||
testMaxMsgSizeServerAPI(t, e)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1538,7 +1538,7 @@ func testMaxMsgSizeClientDefault(t *testing.T, e env) {
|
|||
}
|
||||
}
|
||||
|
||||
func testMaxMsgSizeClientApi(t *testing.T, e env) {
|
||||
func testMaxMsgSizeClientAPI(t *testing.T, e env) {
|
||||
te := newTest(t, e)
|
||||
te.userAgent = testAppUA
|
||||
// To avoid error on server side.
|
||||
|
@ -1619,7 +1619,7 @@ func testMaxMsgSizeClientApi(t *testing.T, e env) {
|
|||
}
|
||||
}
|
||||
|
||||
func testMaxMsgSizeServerApi(t *testing.T, e env) {
|
||||
func testMaxMsgSizeServerAPI(t *testing.T, e env) {
|
||||
te := newTest(t, e)
|
||||
te.userAgent = testAppUA
|
||||
te.maxServerReceiveMsgSize = 1024
|
||||
|
|
Loading…
Reference in New Issue