This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 440d4d8de6c branch-3.0: [fix](trino connector catalog) enable 
self-attachment for Java agents and adjust settings for Mac systems #49520 
(#49680)
440d4d8de6c is described below

commit 440d4d8de6c59ce43b01c3674f4676f05e45358c
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Apr 24 09:25:59 2025 +0800

    branch-3.0: [fix](trino connector catalog) enable self-attachment for Java 
agents and adjust settings for Mac systems #49520 (#49680)
    
    Cherry-picked from #49520
    
    Co-authored-by: zy-kkk <[email protected]>
---
 .../apache/doris/trinoconnector/TrinoConnectorPluginLoader.java   | 8 ++++++++
 .../datasource/trinoconnector/TrinoConnectorPluginLoader.java     | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git 
a/fe/be-java-extensions/trino-connector-scanner/src/main/java/org/apache/doris/trinoconnector/TrinoConnectorPluginLoader.java
 
b/fe/be-java-extensions/trino-connector-scanner/src/main/java/org/apache/doris/trinoconnector/TrinoConnectorPluginLoader.java
index 472260aa35a..6e74929df70 100644
--- 
a/fe/be-java-extensions/trino-connector-scanner/src/main/java/org/apache/doris/trinoconnector/TrinoConnectorPluginLoader.java
+++ 
b/fe/be-java-extensions/trino-connector-scanner/src/main/java/org/apache/doris/trinoconnector/TrinoConnectorPluginLoader.java
@@ -53,6 +53,14 @@ public class TrinoConnectorPluginLoader {
 
         static {
             try {
+                // Allow self-attachment for Java agents,this is required for 
certain debugging and monitoring functions
+                System.setProperty("jdk.attach.allowAttachSelf", "true");
+                // Get the operating system name
+                String osName = System.getProperty("os.name").toLowerCase();
+                // Skip HotSpot SAAttach for Mac/Darwin systems to avoid 
potential issues
+                if (osName.contains("mac") || osName.contains("darwin")) {
+                    System.setProperty("jol.skipHotspotSAAttach", "true");
+                }
                 // Trino uses jul as its own log system, so the attributes of 
JUL are configured here
                 System.setProperty("java.util.logging.SimpleFormatter.format",
                         "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s: 
%5$s%6$s%n");
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/trinoconnector/TrinoConnectorPluginLoader.java
 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/trinoconnector/TrinoConnectorPluginLoader.java
index c846e2edf42..a6f42d0ae15 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/trinoconnector/TrinoConnectorPluginLoader.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/trinoconnector/TrinoConnectorPluginLoader.java
@@ -54,6 +54,14 @@ public class TrinoConnectorPluginLoader {
 
         static {
             try {
+                // Allow self-attachment for Java agents,this is required for 
certain debugging and monitoring functions
+                System.setProperty("jdk.attach.allowAttachSelf", "true");
+                // Get the operating system name
+                String osName = System.getProperty("os.name").toLowerCase();
+                // Skip HotSpot SAAttach for Mac/Darwin systems to avoid 
potential issues
+                if (osName.contains("mac") || osName.contains("darwin")) {
+                    System.setProperty("jol.skipHotspotSAAttach", "true");
+                }
                 // Trino uses jul as its own log system, so the attributes of 
JUL are configured here
                 System.setProperty("java.util.logging.SimpleFormatter.format",
                         "%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s: 
%5$s%6$s%n");


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

Reply via email to