CRZbulabula commented on code in PR #19132:
URL: https://github.com/apache/iotdb/pull/19132#discussion_r4477947667
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/enums/HandleSystemErrorStrategy.java:
##########
@@ -50,4 +61,20 @@ public void handle(String errorReason) {
System.exit(-1);
}
}
+
+ private static String formatMessage(Throwable e) {
+ String message = e.getMessage();
+ message = message == null ? "" : SEPARATORS.trimAndCollapseFrom(message, '
');
Review Comment:
Could this normalize incrementally into a buffer capped at the first 256
UTF-16 units? `trimAndCollapseFrom` can materialize a normalized copy
proportional to the full exception message before the length check below. If a
storage or WAL failure carries a very large message, this adds a large
transient allocation while handling the unrecoverable error and may prevent the
node from recording read-only status.
--
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]