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

Sync Producer: Don't change config in constructor #790

Merged
merged 1 commit into from
Nov 25, 2016

Conversation

eapache
Copy link
Contributor

@eapache eapache commented Nov 24, 2016

It's surprising, for one thing, and as Alexander Zhuravlev discovered it can
actually lead to data races if you already have async producers active using the
same config object.

Instead, validate that it is pre-set correctly and return a config error if it
is not, so it is on the user to set things up properly (it's only one flag away
from default so it's not that big a deal).

Fixes #789.

cc @zaa

It's surprising, for one thing, and as Alexander Zhuravlev discovered it can
actually lead to data races if you already have async producers active using the
same config object.

Instead, validate that it is pre-set correctly and return a config error if it
is not, so it is on the user to set things up properly (it's only one flag away
from default so it's not that big a deal).
@wvanbergen
Copy link
Contributor

There's no easy way to clone a config, and set the properties to true on the cloned value?

@eapache
Copy link
Contributor Author

eapache commented Nov 24, 2016

We considered that in #789; there are a bunch of config values where it doesn't make any sense to have different instances of the config.

@zaa
Copy link

zaa commented Nov 25, 2016

@eapache Looks great, thanks.

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.

3 participants