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/01 13:00:32 UTC

[GitHub] [rocketmq-client-cpp] SRC-xiaojin opened a new pull request, #427: Watermark

SRC-xiaojin opened a new pull request, #427:
URL: https://github.com/apache/rocketmq-client-cpp/pull/427

   ## What is the purpose of the change
   
   Reduce the number of eventcb callback
   
   ## Brief changelog
   
   set read water mark to msgLen + 4,wait for receiving whole data; reset read water mark to 4 after user's callback
   
   ## Verifying this change
   
   the body size of msg is 2k
   msg count is 1W
   use Producer.c and PullConsumer.cpp for test
   As I tested, could reduce latency a litter
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when a cross-module dependency exists.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


-- 
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-client-cpp] ifplusor commented on a diff in pull request #427: Watermark

Posted by GitBox <gi...@apache.org>.
ifplusor commented on code in PR #427:
URL: https://github.com/apache/rocketmq-client-cpp/pull/427#discussion_r912290326


##########
src/transport/TcpTransport.cpp:
##########
@@ -277,6 +281,10 @@ void TcpTransport::readNextMessageIntCallback(BufferEvent* event, TcpTransport*
 
       transport->messageReceived(msg, event->getPeerAddrPort());
     }
+    /**
+     * reset read water mark to 4
+     */
+    event->setWatermark(EV_READ, 4, 0);

Review Comment:
   Move to line 259.



-- 
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-client-cpp] ifplusor commented on a diff in pull request #427: Watermark

Posted by GitBox <gi...@apache.org>.
ifplusor commented on code in PR #427:
URL: https://github.com/apache/rocketmq-client-cpp/pull/427#discussion_r912314847


##########
src/transport/TcpTransport.cpp:
##########
@@ -277,6 +281,10 @@ void TcpTransport::readNextMessageIntCallback(BufferEvent* event, TcpTransport*
 
       transport->messageReceived(msg, event->getPeerAddrPort());
     }
+    /**
+     * reset read water mark to 4
+     */
+    event->setWatermark(EV_READ, 4, 0);

Review Comment:
   If `needed` is greater than 0, `hdr` is incomplete, return and wait for more data. The function does not return 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-client-cpp] SRC-xiaojin commented on a diff in pull request #427: Watermark

Posted by GitBox <gi...@apache.org>.
SRC-xiaojin commented on code in PR #427:
URL: https://github.com/apache/rocketmq-client-cpp/pull/427#discussion_r912314070


##########
src/transport/TcpTransport.cpp:
##########
@@ -277,6 +281,10 @@ void TcpTransport::readNextMessageIntCallback(BufferEvent* event, TcpTransport*
 
       transport->messageReceived(msg, event->getPeerAddrPort());
     }
+    /**
+     * reset read water mark to 4
+     */
+    event->setWatermark(EV_READ, 4, 0);

Review Comment:
   at line 259, the water matk is already 4
   so I think need reset read water mark to 4 after received whole data and user's callback



-- 
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-client-cpp] ifplusor merged pull request #427: Watermark

Posted by GitBox <gi...@apache.org>.
ifplusor merged PR #427:
URL: https://github.com/apache/rocketmq-client-cpp/pull/427


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