uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
345 stars 131 forks source link

yarpc.NewDispatcher opens an inbound port #393

Closed tsublette closed 6 years ago

tsublette commented 6 years ago

Upon creating a new dispatcher, the process tries to open an inbound port and causes a firewall warning on windows. Why is it opening this port and is there a way to keep it from happening?

    b.dispatcher = yarpc.NewDispatcher(yarpc.Config{
        Name: _cadenceClientName,
        Outbounds: yarpc.Outbounds{
            _cadenceFrontendService: {Unary: ch.NewSingleOutbound(b.hostPort)},
        },
    })
madhuravi commented 6 years ago

This is a bug in YARPC. See https://github.com/yarpc/yarpc-go/issues/1401

ryanwalls commented 6 years ago

@mfateev @madhuravi Haven't dug into this much, but is there another transport we could use when we configure the client that wouldn't use yarpc? When yarpc opens up an inbound port, does it listen on 127.0.0.1 or on 0.0.0.0?

ryanwalls commented 6 years ago

Found a potential solution: https://github.com/yarpc/yarpc-go/issues/1401#issuecomment-364785142

Trying it now.

madhuravi commented 6 years ago

Sounds good, let us know.

vancexu commented 6 years ago

This can be fixed by adding ListenAddr to 127.0.0.1:0, sample code.

        ch, err := tchannel.NewChannelTransport(
        tchannel.ServiceName(serviceName), tchannel.ListenAddr("127.0.0.1:0"))
    if err != nil {
        logger.Fatal("Failed to create transport channel", zap.Error(err))
    }

    dispatcher = yarpc.NewDispatcher(yarpc.Config{
        Name: clientName,
        Outbounds: yarpc.Outbounds{
            serviceName: {Unary: ch.NewSingleOutbound(hostPort)},
        },
    })