github-actions[bot] commented on code in PR #61131:
URL: https://github.com/apache/doris/pull/61131#discussion_r2904852094


##########
be/src/load/channel/tablets_channel.cpp:
##########
@@ -637,7 +645,9 @@ Status TabletsChannel::add_batch(const 
PTabletWriterAddBlockRequest& request,
                                  PTabletWriterAddBlockResult* response) {
     SCOPED_TIMER(_add_batch_timer);
     int64_t cur_seq = 0;
-    _add_batch_number_counter->update(1);
+    if (_add_batch_number_counter) {
+        _add_batch_number_counter->update(1);

Review Comment:
   **Critical: Missing parallel fix in CloudTabletsChannel**
   
   This null guard was correctly added for the non-cloud 
`TabletsChannel::add_batch()`, but the parallel code path in 
`CloudTabletsChannel::add_batch()` (`cloud_tablets_channel.cpp:49`) still has:
   ```cpp
   _add_batch_number_counter->update(1);
   ```
   without any null guard. Since this PR makes it possible for 
`_add_batch_number_counter` to be `nullptr` (when `profile == nullptr` is 
passed to the constructor), this will cause a **null pointer dereference crash 
in cloud mode** when `enable_profile` is false.
   
   Please apply the same fix to `cloud_tablets_channel.cpp:49`:
   ```cpp
   if (_add_batch_number_counter) {
       _add_batch_number_counter->update(1);
   }
   ```



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