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/03/31 12:24:04 UTC

[GitHub] [rocketmq] Hen1ng opened a new issue #4074: org.apache.rocketmq.store.AllocateMappedFileService#putRequestAndReturnMappedFile方法中的hasException是不是有问题?

Hen1ng opened a new issue #4074:
URL: https://github.com/apache/rocketmq/issues/4074


   The issue tracker is used for bug reporting purposes **ONLY** whereas feature request needs to follow the [RIP process](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal). To avoid unnecessary duplication, please check whether there is a previous issue before filing a new one.
   
   It is recommended to start a discussion thread in the [mailing lists](http://rocketmq.apache.org/about/contact/) in cases of discussing your deployment plan, API clarification, and other non-bug-reporting issues.
   We welcome any friendly suggestions, bug fixes, collaboration, and other improvements.
   
   Please ensure that your bug report is clear and self-contained. Otherwise, it would take additional rounds of communication, thus more time, to understand the problem itself.
   
   Generally, fixing an issue goes through the following steps:
   1. Understand the issue reported;
   1. Reproduce the unexpected behavior locally;
   1. Perform root cause analysis to identify the underlying problem;
   1. Create test cases to cover the identified problem;
   1. Work out a solution to rectify the behavior and make the newly created test cases pass;
   1. Make a pull request and go through peer review;
   
   As a result, it would be very helpful yet challenging if you could provide an isolated project reproducing your reported issue. Anyway, please ensure your issue report is informative enough for the community to pick up. At a minimum, include the following hints:
   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   ![image](https://user-images.githubusercontent.com/72974271/161052907-63b01b92-0285-400f-bf7d-ca1e7eba5852.png)
   
   这个hasException是一个volatile修饰的boolean类型,在mmapOperation方法中修改其状态,但是是不是有下面的情况
   ![image](https://user-images.githubusercontent.com/72974271/161053466-3d8ef503-2c87-41aa-84f1-6704a74fe2dd.png)
   
   就是发生异常的mappedFile和正要创建的mappedFile不是一个而导致了误认为正要创建的mappedFile发生了异常而返回了null。
   
   - What did you do (The steps to reproduce)?
   
   - What is expected to see?
   
   - What did you see instead?
   
   2. Please tell us about your environment:
   
   3. 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?
   
   4. 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

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



[GitHub] [rocketmq] ni-ze commented on issue #4074: Is there some problem in the method(org.apache.rocketmq.store.AllocateMappedFileService#putRequestAndReturnMappedFile.)?Which may cause the mappedFile is creating return null

Posted by GitBox <gi...@apache.org>.
ni-ze commented on issue #4074:
URL: https://github.com/apache/rocketmq/issues/4074#issuecomment-1086502489


   Return null is correct, What do you expected to see?


-- 
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] Hen1ng commented on issue #4074: Is there some problem in the method(org.apache.rocketmq.store.AllocateMappedFileService#putRequestAndReturnMappedFile.)?Which may cause the mappedFile is creating return null

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


   有一这个putRequestAndReturnMappedFile这个方法一次put两个到请求队列中,可能线程处理到第二个请求的时候发生了异常hasException置为true,这时候再次调用putRequestAndReturnMappedFile这个方法的时候,就会返回null,这个是期望的吗


-- 
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] ni-ze commented on issue #4074: Is there some problem in the method(org.apache.rocketmq.store.AllocateMappedFileService#putRequestAndReturnMappedFile.)?Which may cause the mappedFile is creating return null

Posted by GitBox <gi...@apache.org>.
ni-ze commented on issue #4074:
URL: https://github.com/apache/rocketmq/issues/4074#issuecomment-1086608416


   The second one has error,  but first one success, so the first request will success and return the first one mappedFile. Second request will occur error and and return null, which is correct because the first arg of second request is exactly the second arg of first request. just like this:
   ```java
   //first request
   public MappedFile putRequestAndReturnMappedFile(String "/store/1", String "/store/2", int fileSize) {
   }
   
   //second  request
   public MappedFile putRequestAndReturnMappedFile(String "/store/2", String "/store/3", int fileSize) {
     //the mappedFile is created by the first request.
   }
   ```


-- 
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] Hen1ng commented on issue #4074: Is there some problem in the method(org.apache.rocketmq.store.AllocateMappedFileService#putRequestAndReturnMappedFile.)?Which may cause the mappedFile is creating return null

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


   @ni-ze If the mappedFile occur exception is not the one which is creating, it cause the mappedFile is creating return null, is this correct? Please review the second picture above. Is the scenario correct?


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