smengcl edited a comment on issue #415: HDDS-2840. Implement ofs://: mkdir
URL: https://github.com/apache/hadoop-ozone/pull/415#issuecomment-574954076
 
 
   > Thanks for working on this @smengcl. I have started reviewing the PR.
   > 
   > In BasicRootedOzoneClientAdapterImpl, setting volume and bucket globally 
could lead to discrepancies.
   > Let's say my client creates one OzoneClient and multiple threads share 
this object.
   > Thread1 - createFile /vol1/bucket1/key1
   > Thread2 - createFile /vol1/bucket2/key2
   > 
   > ```
   > t1 - Thread1 sets bucket = bucket1
   > t2 - Thread2 sets bucket = bucket2
   > t3 - Thread1 executes bucket.createFile -> This would create key1 in 
bucket2.
   > ```
   
   Good point. The current implementation is not thread-safe.
   I believe I can just make `volume` and `bucket` local in each function to 
eliminate such race condition.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to