Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server type blacklist and concurrent server get on etcd to improv… #119

Merged
merged 19 commits into from
Nov 13, 2019

Conversation

leohahn
Copy link
Contributor

@leohahn leohahn commented Nov 8, 2019

…e startup time.

}

// We sleep to guarantee that the servers were added to etcd
time.Sleep(time.Millisecond * 50)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may make the test flaky, don't you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server is in memory, so this should be a very large margin. Do you think something else is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, the cli.Put method is synchronous, so the sleep is probably unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are better ways of waiting in a test, something like that:

https://github.com/topfreegames/pitaya/blob/master/cluster/nats_rpc_client_test.go#L158

let me know what you think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other example

helpers.ShouldEventuallyReturn(t, s.NumSubscriptions, uint32(1))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no simple way of doing that because for some reason sync.Map does not have a Len method. But I'll see a way of doing it.

Copy link
Contributor

@felipejfc felipejfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @leohahn. I left some comments.
Please, include the information about the configs you are adding in the documentation:
https://github.com/topfreegames/pitaya/blob/master/docs/configuration.rst

cluster/etcd_service_discovery.go Outdated Show resolved Hide resolved
cluster/etcd_service_discovery.go Outdated Show resolved Hide resolved
cluster/etcd_service_discovery.go Outdated Show resolved Hide resolved
cluster/etcd_service_discovery.go Outdated Show resolved Hide resolved
cluster/etcd_service_discovery.go Outdated Show resolved Hide resolved
cluster/etcd_service_discovery.go Outdated Show resolved Hide resolved
cluster/nats_rpc_client.go Outdated Show resolved Hide resolved
cluster/nats_rpc_server.go Outdated Show resolved Hide resolved
@felipejfc
Copy link
Contributor

felipejfc commented Nov 11, 2019

Next time please split the PR, e.g.

PR1 - Server blacklist
PR2 - Concurrent server gets

=== EDIT

also add a proper description to them

}

// We sleep to guarantee that the servers were added to etcd
time.Sleep(time.Millisecond * 50)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are better ways of waiting in a test, something like that:

https://github.com/topfreegames/pitaya/blob/master/cluster/nats_rpc_client_test.go#L158

let me know what you think

sd.serverTypesBlacklist = sd.config.GetStringSlice("pitaya.cluster.sd.etcd.servertypeblacklist")
sd.syncServersParallelism = sd.config.GetInt("pitaya.cluster.sd.etcd.syncserversparallelism")

if sd.syncServersParallelism == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we still have this if? Aren't you specifying a default for that already?

Copy link
Contributor

@felipejfc felipejfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job, lgtm

@felipejfc felipejfc merged commit 287b60e into master Nov 13, 2019
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.

None yet

3 participants