SyncCluster: Skip empty cluster updates.#214
Conversation
|
This allows us to connect to the cluster without waiting for it to be properly started (although we have an incomplete list of machines, but a periodic Tested and works fine in CI. related to #213 (last comment) /cc @yichengq Is there anything else that we missed about the issue and the logic behind |
etcd/client.go
Outdated
|
Could you update the comment for This change is reasonable IMO because nobody wants to update to a empty client urls. A better solution may be let etcd not return member info before it has been fully initialized. lgtm /cc @xiang90 |
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2698e87 to
d31f99f
Compare
|
@yichengq Thanks, PTAL. I agree that fixing etcd is a better solution - after all, it should never return an empty list (at the very least it should return its own address). However, even if we did fix that, I believe we should still push this client change to handle backward compatibility. |
|
lgtm. Thanks for the contribution! 🚢 |
SyncCluster: Skip empty cluster updates.
|
Thank you! |
|
Thanks @yichengq! 🎈 |
This change prevents doing an "empty" cluster update.
When
etcdis not yet fully initialized, it tends to return an empty list of members.Since
internalSyncClusteruses the result of the previous run (it iterates overcluster.Machineswhich is also filled byinternalSyncCluster), it means that if we do an empty update the client is forever broken:c.cluster.Machineswill be empty therefore further calls toSyncClusterwill be a no-op.Signed-off-by: Andrea Luzzardi aluzzardi@gmail.com