Codebase list golang-github-go-kit-kit / 8c84d88
fix: `ProtectedEphemeralSequential` in the wrong zk path (#849) ```golang register := zk.NewRegistrar(client,zk.Service{ Path: "/services/hello", Name: "abc", Data: []byte("http://127.0.0.1:8080"), },logger) ``` > It will be created in zk ```sh [zk: localhost:2181(CONNECTED) 161] ls /services/hello [_c_c83db041ac654566228b72cbd541bcb5-abc0000000006, abc] ``` **/services/hello/_c_c83db041ac654566228b72cbd541bcb5** is correct **/services/hello/abc** is empty node ```golang //will get 0 instance zk.NewInstancer(client,"/services/hello/abc",logger) //will get 2 instances, one of them is <nil> zk.NewInstancer(client,"/services/hello",logger) ``` In my understanding, [CreateProtectedEphemeralSequential](https://github.com/go-kit/kit/blob/master/sd/zk/client.go#L241) function will be created under `/services/hello/abc` So is this a bug? Or there's something wrong with my usage? RedDragonet authored 5 years ago Peter Bourgon committed 5 years ago
1 changed file(s) with 3 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
237237 if err := c.CreateParentNodes(path); err != nil {
238238 return err
239239 }
240 if path[len(path)-1] != '/' {
241 path += "/"
242 }
240243 node, err := c.CreateProtectedEphemeralSequential(path, s.Data, c.acl)
241244 if err != nil {
242245 return err