You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@auron.apache.org by "cxzl25 (via GitHub)" <gi...@apache.org> on 2025/11/20 04:51:26 UTC

[PR] [AURON #1639] Avoid ByteBuddyAgent inject when class not found [auron]

cxzl25 opened a new pull request, #1640:
URL: https://github.com/apache/auron/pull/1640

   <!--
   Thanks for sending a pull request!  Please keep the following tips in mind:
     - Start the PR title with the related issue ID, e.g. '[AURON #XXXX] Short summary...'.
     - Make your PR title clear and descriptive, summarizing what this PR changes.
     - Provide a concise example to reproduce the issue, if possible.
     - Keep the PR description up to date with all changes.
   -->
   
   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #1639
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   
   # How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


-- 
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: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #1639] Avoid ByteBuddyAgent inject when class not found [auron]

Posted by "yew1eb (via GitHub)" <gi...@apache.org>.
yew1eb commented on PR #1640:
URL: https://github.com/apache/auron/pull/1640#issuecomment-3585423161

   LGTM


-- 
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: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #1639] Avoid ByteBuddyAgent inject when class not found [auron]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1640:
URL: https://github.com/apache/auron/pull/1640#discussion_r2554634562


##########
spark-extension-shims-spark/src/main/java/org/apache/spark/sql/auron/ValidateSparkPlanInjector.java:
##########
@@ -31,19 +31,27 @@
 public class ValidateSparkPlanInjector {
 
     private static final Logger logger = LoggerFactory.getLogger(ValidateSparkPlanInjector.class);
+    private static volatile boolean classNotFound = false;
     private static boolean injected = false;
 
     public static synchronized void inject() {
         if (injected) {
             logger.warn("ValidateSparkPlan already injected, skipping.");
             return;
         }
+        if (classNotFound) {

Review Comment:
   Consider adding a log message when skipping injection due to `classNotFound` being true. This would provide better observability and debugging information, similar to the existing log message at line 39 for the `injected` case. For example: `logger.debug("ValidateSparkPlan class not found, skipping injection.");`
   ```suggestion
           if (classNotFound) {
               logger.debug("ValidateSparkPlan class not found, skipping injection.");
   ```



##########
spark-extension-shims-spark/src/main/java/org/apache/spark/sql/auron/ValidateSparkPlanInjector.java:
##########
@@ -31,19 +31,27 @@
 public class ValidateSparkPlanInjector {
 
     private static final Logger logger = LoggerFactory.getLogger(ValidateSparkPlanInjector.class);
+    private static volatile boolean classNotFound = false;
     private static boolean injected = false;

Review Comment:
   The `injected` field should also be declared as `volatile` for thread safety, similar to `classNotFound`. While the method is synchronized, the read of `injected` at line 38 occurs without synchronization from other potential readers. This ensures proper visibility of the flag across threads.
   ```suggestion
       private static volatile boolean injected = false;
   ```



-- 
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: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #1639] Avoid ByteBuddyAgent inject when class not found [auron]

Posted by "cxzl25 (via GitHub)" <gi...@apache.org>.
cxzl25 commented on PR #1640:
URL: https://github.com/apache/auron/pull/1640#issuecomment-3568900617

   @richox 


-- 
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: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AURON #1639] Avoid ByteBuddyAgent inject when class not found [auron]

Posted by "richox (via GitHub)" <gi...@apache.org>.
richox merged PR #1640:
URL: https://github.com/apache/auron/pull/1640


-- 
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: commits-unsubscribe@auron.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org