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


##########
fs_brokers/cdc_client/src/main/java/org/apache/doris/cdcclient/utils/ConfigUtil.java:
##########
@@ -123,9 +124,25 @@ public static ZoneId 
getPostgresServerTimeZoneFromProps(java.util.Properties pro
         return ZoneId.systemDefault();
     }
 
+    public static final String MAX_QUEUE_BYTES_SYS_PROP = 
"cdc.max.queue.size.in.bytes";
+
+    // Heap-adaptive byte cap for the debezium ChangeEventQueue buffer.
+    // heap 1G->64MB, 2G->128MB, >=4G->256MB. -D<MAX_QUEUE_BYTES_SYS_PROP> 
overrides (<=0 disables).
+    private static long resolveMaxQueueSizeInBytes() {
+        Long override = Long.getLong(MAX_QUEUE_BYTES_SYS_PROP);

Review Comment:
   `Long.getLong` returns `null` both when the property is absent and when it 
is present but malformed or out of range. For example, 
`-Dcdc.max.queue.size.in.bytes=32MB` or an overflow value will be silently 
ignored and the client will run with the adaptive 64-256MB cap. Since this 
property is introduced as the escape hatch for OOM control, a typo should fail 
fast instead of looking like the override was accepted. Please parse 
`System.getProperty(MAX_QUEUE_BYTES_SYS_PROP)` explicitly with 
`Long.parseLong(...)`, keep `<= 0` as the disable path, and add a negative test 
for a malformed override.



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