You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/05 07:42:04 UTC

[GitHub] [incubator-doris] xinghuayu007 opened a new pull request #4257: secure singleton mode

xinghuayu007 opened a new pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257


   ## Proposed changes
   
   The class org.apache.doris.service.ExecuteEnv is not safe in multiple thread environment. This PR is to implement a secure singleton mode.
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [] Bugfix (non-breaking change which fixes an issue)
   - [] New feature (non-breaking change which adds functionality)
   - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [] Documentation Update (if none of the other choices apply)
   - [] Code refactor (Modify the code structure, format the code, etc...)
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [] I have create an issue on #ISSUE, and have described the bug/feature there in detail
   - [x] Compiling and unit tests pass locally with my changes
   - [x] I have added tests that prove my fix is effective or that my feature works
   - [] If this change need a document change, I have updated the document
   - [] Any dependent changes have been merged
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] imay merged pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
imay merged pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xinghuayu007 commented on pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
xinghuayu007 commented on pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257#issuecomment-669123799


   > Maybe you can reference the implement in `Catalog.SingletonHoder` to get a thread-safe singleton instread of use double check lock to implement.
   
   good ideal!


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] caiconghui commented on pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
caiconghui commented on pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257#issuecomment-669867130


   > Hi, @imay The code has no problem in logic, but I think sychornized will have poor performance than static method, why we keep the double check lock? Is there anything i didn't consider into account?thx~~
   
   @WingsGo The performance is not poor, only double check in initial operation


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] WingsGo commented on pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
WingsGo commented on pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257#issuecomment-669841999


   Hi, @imay The code has no problem in logic, but I think sychornized will have poor performance than static method, why we keep the double check lock? Is there anything i didn't consider into account?thx~~


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] WingsGo edited a comment on pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
WingsGo edited a comment on pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257#issuecomment-669114428


   Maybe you can reference the implement in `Catalog.SingletonHoder` to get a thread-safe singleton instread of use double check lock to implement.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] WingsGo commented on pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
WingsGo commented on pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257#issuecomment-669898814


   @caiconghui , @imay The PR look good to me, but I still think the static method's implement is more elegant and less error-prone


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xinghuayu007 closed pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
xinghuayu007 closed pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] imay commented on pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
imay commented on pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257#issuecomment-669881975


   > Hi, @imay The code has no problem in logic, but I think sychornized will have poor performance than static method, why we keep the double check lock? Is there anything i didn't consider into account?thx~~
   
   My opinion is the same with conghui's. 


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] WingsGo commented on pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
WingsGo commented on pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257#issuecomment-669114428


   Maybe you can reference the implement in `Catalog.SingletonHoder` to get a thread-safe singleton without lock it.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on pull request #4257: secure singleton mode

Posted by GitBox <gi...@apache.org>.
morningman commented on pull request #4257:
URL: https://github.com/apache/incubator-doris/pull/4257#issuecomment-669900530


   I have not tested the efficiency issue, but I think that it is better to keep the singleton implementation consistent in a system.
   Both should be OK, but should choose one and only use one.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org