You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/07/13 02:33:35 UTC

[GitHub] [rocketmq] Oliverwqcwrw opened a new issue, #4591: Inconsistent behavior

Oliverwqcwrw opened a new issue, #4591:
URL: https://github.com/apache/rocketmq/issues/4591

   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   I notice the `org.apache.rocketmq.logging.inner.LoggingBuilder.FileAppender#setFile(java.lang.String, boolean, boolean, int)` is decorated by synchronized,but `org.apache.rocketmq.logging.inner.LoggingBuilder.FileAppender#getFile` do not decorated by synchronized, if someone call getName() will occur inconsistent behavior
   
   - What did you do (The steps to reproduce)?
   
   - What is expected to see?
   
   - What did you see instead?
   
   3. Please tell us about your environment:
   
   4. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
   
   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   
   2. Provide any additional detail on your proposed use case for this feature.
   
   2. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?
   
   5. If there are some sub-tasks involved, use -[] for each sub-task and create a corresponding issue to map to the sub-task:
   
   - [sub-task1-issue-number](example_sub_issue1_link_here): sub-task1 description here, 
   - [sub-task2-issue-number](example_sub_issue2_link_here): sub-task2 description here,
   - ...
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] djl394922860 commented on issue #4591: Inconsistent behavior

Posted by GitBox <gi...@apache.org>.
djl394922860 commented on issue #4591:
URL: https://github.com/apache/rocketmq/issues/4591#issuecomment-1182703622

   it can use `volatile` replace `synchronized` ?


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] duhenglucky closed issue #4591: Inconsistent behavior

Posted by GitBox <gi...@apache.org>.
duhenglucky closed issue #4591: Inconsistent behavior
URL: https://github.com/apache/rocketmq/issues/4591


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on issue #4591: Inconsistent behavior

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on issue #4591:
URL: https://github.com/apache/rocketmq/issues/4591#issuecomment-1183840962

   1、I think `org.apache.rocketmq.logging.inner.LoggingBuilder.FileAppender#setFile(java.lang.String)` also need `synchronized `
   
   2、You are right, there do not exist concurrency issue, However, if someone calls this method in the future, synchronization control will be added, I think it's ok to add it in advance
   
   Thanks for your advice 


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] djl394922860 commented on issue #4591: Inconsistent behavior

Posted by GitBox <gi...@apache.org>.
djl394922860 commented on issue #4591:
URL: https://github.com/apache/rocketmq/issues/4591#issuecomment-1182726675

   > Thanks for your reply IMO, I think it would be more appropriate for getFile to wait while setFile() is executed. Indeed, there is no place to call `getFile()` at present, but if someone calls it in the future, inconsistent behavior may occur
   
   yep , if `getFile()` need to wait for `setFile()` , u are right , i got it , thx your reply.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on issue #4591: Inconsistent behavior

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on issue #4591:
URL: https://github.com/apache/rocketmq/issues/4591#issuecomment-1182717413

   Thanks for your reply 
   IMO, I think it would be more appropriate for getFile to wait while setFile() is executed. Indeed, there is no place to call `getFile()` at present, but if someone calls it in the future, inconsistent behavior may occur


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] djl394922860 commented on issue #4591: Inconsistent behavior

Posted by GitBox <gi...@apache.org>.
djl394922860 commented on issue #4591:
URL: https://github.com/apache/rocketmq/issues/4591#issuecomment-1182750234

   I looked again and found 
   1、`FileAppender` other method like `org.apache.rocketmq.logging.inner.LoggingBuilder.FileAppender#setFile(java.lang.String)` is not decorated by synchronized , Is it necessary here and other places?
   2、for `fileName` field is direct use like `this.fileName` , not use `getFile()` , so is there a concurrency issue here?
   Forgive me for more questions....etc , thx again


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org