Skip to content

fix thread safety issue #74

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

Merged
merged 1 commit into from
Dec 12, 2022
Merged

fix thread safety issue #74

merged 1 commit into from
Dec 12, 2022

Conversation

carl-db
Copy link
Contributor

@carl-db carl-db commented Dec 10, 2022

Stack created with Sapling. Best reviewed with ReviewStack.

fix thread safety issue

This fixes a thread safety (and structural issue) with connector. Because connectors have a long lifetime (potentially process-lifetime), and are used by multiple threads it's not safe to share the same thrift client connection.

This changes the connector so that a new thrift client is created on each connection. The go DB library will perform pooling of connections, so we don't need to worry about it here.

Signed-off-by: Carl Verge [email protected]

@andrefurlan-db
Copy link
Contributor

Hi @carl-db, thanks for the PR. Can you commit with -s to pass the DCO check?

This fixes a thread safety (and structural issue) with connector. Because connectors have a long lifetime (potentially process-lifetime), and are used by multiple threads it's not safe to share the same thrift client connection.

This changes the connector so that a new thrift client is created on each connection. The go DB library will perform pooling of connections, so we don't need to worry about it here.

Signed-off-by: Carl Verge <[email protected]>
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