FangzuoZhang commented on code in PR #3484:
URL: https://github.com/apache/brpc/pull/3484#discussion_r3891274868


##########
src/brpc/input_messenger.h:
##########
@@ -91,6 +94,24 @@ class InputMessageClosure {
     InputMessageBase* _msg;
 };
 
+class InputMessageBatch {
+public:
+    InputMessageBatch() {}
+    explicit InputMessageBatch(size_t capacity);
+    ~InputMessageBatch() noexcept(false);

Review Comment:
   Addressed in commit 95368dbd.
   
   `InputMessageBatch::~InputMessageBatch` is now `noexcept`. Before invoking a 
handler, `Run()` clears the corresponding message slot so that an 
already-delivered message cannot be processed again.
   
   The destructor catches all exceptions raised during handler execution, logs 
an English error message, and destroys any remaining undelivered messages. The 
bthread batch entry also contains handler exceptions so that they cannot escape 
through the bthread callback boundary.
   
   The unit test verifies the nothrow destructor property, injects a handler 
exception, confirms that the exception does not propagate, and checks that the 
remaining messages are cleaned up exactly once.



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