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

Clarify: Is a minio Client thread-safe? #598

Closed
mcandre opened this issue Feb 1, 2017 · 5 comments
Closed

Clarify: Is a minio Client thread-safe? #598

mcandre opened this issue Feb 1, 2017 · 5 comments

Comments

@mcandre
Copy link

mcandre commented Feb 1, 2017

Are minio client objects thread-safe? Or are users perhaps encouraged to create one client instance per goroutine?

@harshavardhana
Copy link
Member

Are minio client objects thread-safe? Or are users perhaps encouraged to create one client instance per goroutine?

You are expected to hold locks in your application and share the same minio client object. @mcandre

@krishnasrinivas
Copy link
Contributor

Are minio client objects thread-safe? Or are users perhaps encouraged to create one client instance per goroutine?

You are expected to hold locks in your application and share the same minio client object. @mcandre

In other words, minio-client object is thread safe.

@dbregman
Copy link

@harshavardhana says "you are expected to hold locks" translation: NOT threadsafe.
then @krishnasrinivas quotes this saying "In other words, minio-client object is thread safe."

Super confusing contradictory answers. Please clarify:

  1. Is locking needed to use a client object safely from multiple threads
  2. Are multiple client objects required for concurrent requests

If this is documented somewhere, I cannot find it.

@krishnasrinivas
Copy link
Contributor

Sorry for the confusion!

  • Is locking needed to use a client object safely from multiple threads

Locking is not needed to use a client object safely from multiple threads

2. Are multiple client objects required for concurrent requests

No. You can use the same client object for concurrent requests.

@dbregman
Copy link

@krishnasrinivas thank you for the clarification :) It might be good to mention this in the docs too.

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

No branches or pull requests

4 participants