Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE during DelegatingBlockReader initialization with debug logging #18526

Open
wants to merge 1 commit into
base: release-2.9.1
Choose a base branch
from

Conversation

Archie-wang
Copy link

…during the initialization of DelegatingBlockReader with debug log level enabled

What changes are proposed in this pull request?

This PR updates the toString method in DelegatingBlockReader to prevent a NullPointerException when logging at debug level before mBlockReader is initialized. It adds a null check for mBlockReader and returns a descriptive message if it is null.

Why are the changes needed?

The changes are necessary to fix a bug that leads to a NullPointerException during the debug-level logging of the DelegatingBlockReader initialization process.

  1. Prevents NPE in Debug Logging: By adding a null check before accessing mBlockReader.toString(), this PR prevents the NPE that previously occurred during debug logging when mBlockReader was not fully initialized.
  2. Enhances Logging Clarity: The PR ensures that logging during the initialization phase of DelegatingBlockReader provides clear and accurate information, which is crucial for effective debugging and monitoring.

Does this PR introduce any user facing changes?

  1. No change in user-facing APIs: This PR does not modify any APIs that are exposed to the end-users.
  2. No addition or removal of property keys: There are no changes to the configuration properties as part of this PR.
  3. No changes to the WebUI: This PR does not involve any modifications to the WebUI.

…during the initialization of DelegatingBlockReader with debug log level enabled
@alluxio-bot
Copy link
Contributor

Thank you for your pull request.
In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement (CLA).
It's all electronic and will take just a few minutes. Please download CLA form here, sign, and e-mail back to cla@alluxio.org

@jja725
Copy link
Contributor

jja725 commented Feb 22, 2024

hi, thanks for the contribution! do you mind put this into master-2.x? We can later on cherry-pick this to 2.9.1

@Archie-wang
Copy link
Author

@jja725 Hello, the unit test failure of this PR seems unrelated to my changes. Do you have any suggestions?

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.

None yet

4 participants