Skip to content

Conversation

@KnicKnic
Copy link
Contributor

@KnicKnic KnicKnic commented Jan 18, 2020

Related to issue #257

This is not full fix, however will allow an application that is written correctly to not hit the race. What the application would have to do is create the server with no backends, and then immediately update the backends with the backend pool that they want.

This race can be hit using the rest api, or when embeding gobetween as a library.

manager.Create("foo", config.Server{
    Protocol: "tcp",
    Bind:     "127.0.0.1:199",
    Discovery: &config.DiscoveryConfig{
        Kind:                  "static",
        StaticDiscoveryConfig: &config.StaticDiscoveryConfig{StaticList: []string{}},
    },
})
manager.UpdateBackends("foo", &[]core.Backend{core.Backend{Target: core.Target{Host: "127.0.0.1", Port: "8990"}, Stats: core.BackendStats{Live: true}}})

@KnicKnic
Copy link
Contributor Author

KnicKnic commented Aug 4, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants