randomkang commented on code in PR #3144:
URL: https://github.com/apache/brpc/pull/3144#discussion_r4576879238


##########
src/brpc/checksum.h:
##########
@@ -42,12 +42,16 @@ struct ChecksumIn {
 };
 
 struct ChecksumHandler {
-    // checksum `buf'.
-    // Returns checksum value
-    void (*Compute)(const ChecksumIn& in);
+    // checksum `buf' and store the value in the controller.
+    // Returns true on success. Returns false when the checksum could not be
+    // computed (e.g. GPU memory read failure with GDR); the controller is
+    // left without a checksum value and the caller must fail the RPC instead
+    // of sending data whose checksum was never calculated.
+    bool (*Compute)(const ChecksumIn& in);

Review Comment:
   ok, 1) revert the api change of ChecksumHandler and RegisterChecksumHandler; 
2) only the api of private function in src/brpc/policy/crc32c_checksum.cpp  
will be changed 3) SerializeRpcMessage() checks cntl.Failed() right after 
ComputeDataChecksum() and aborts the RPC.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to