Skip to content

Conversation

@wbo4958
Copy link
Collaborator

@wbo4958 wbo4958 commented Nov 6, 2025

It's a regression issue. The Python listener should be set to None when it fails to register.

To fix #229

It's a regression issue. The Python listener should be set to None when it fails to register.

Signed-off-by: Bobby Wang <wbo4958@gmail.com>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

Fixed regression introduced in PR #226 where listener variable wasn't set to None after registration failure, causing TypeError when attempting to unregister.

  • Added listener = None assignment in exception handler at nds/PysparkBenchReport.py:79
  • Prevents calling unregister() on partially initialized listener object when com.nvidia.spark.rapids.listener.Manager is not available

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is a simple one-line change that correctly handles the error condition by setting listener to None after registration failure, preventing the TypeError during unregister. The fix is well-targeted, addresses the root cause, and has no side effects.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
nds/PysparkBenchReport.py 5/5 Fixed regression where listener object wasn't set to None after registration failure, preventing TypeError during unregister

Sequence Diagram

sequenceDiagram
    participant Report as PysparkBenchReport
    participant Listener as PythonListener
    participant JVM as Spark JVM
    
    Note over Report: report_on() called
    Report->>Report: _register_python_listener()
    Report->>Listener: Create PythonListener()
    Report->>Listener: register()
    Listener->>JVM: get_manager()
    JVM-->>Listener: TypeError (Manager not found)
    Note over Report: Before fix: listener object remains
    Note over Report: After fix: listener = None
    
    Note over Report: Query execution...
    
    alt listener is not None (Before fix)
        Report->>Listener: unregister()
        Listener->>JVM: get_manager()
        JVM-->>Listener: JavaPackage (not callable)
        Note over Report: TypeError: 'JavaPackage' object is not callable
    else listener is None (After fix)
        Note over Report: Skip unregister, no error
    end
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@wbo4958
Copy link
Collaborator Author

wbo4958 commented Nov 6, 2025

Hi @jihoonson, Could you help review this PR, thx.

@mattahrens mattahrens merged commit f47900e into NVIDIA:dev Nov 6, 2025
3 checks passed
@wbo4958 wbo4958 deleted the listener-fix branch November 6, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] NDS power run fails with TypeError: 'JavaPackage' object is not callable

2 participants