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 #18528

Open
wants to merge 1 commit into
base: master-2.x
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

@Archie-wang
Copy link
Author

alluxio-bot, check this please

@alluxio-bot
Copy link
Contributor

Automated checks report:

  • PR title follows the conventions: FAIL
    • The title of the PR does not pass all the checks. Please fix the following issues:
      • First word of title ("Fixed") is not an imperative verb. Please use one of the valid words
  • Commits associated with Github account: FAIL
    • It looks like your commits can't be linked to a valid Github account.
      Your commits are made with the email wangqixiang9@jd.com, which does not allow your contribution to be tracked by Github.
      See this link for possible reasons this might be happening.
      To change the author email address that your most recent commit was made under, you can run:
      git -c user.name="Name" -c user.email="Email" commit --amend --reset-author
      See this answer for more details about how to change commit email addresses.
      Once the author email address has been updated, update the pull request by running:
      git push --force https://github.com/Archie-wang/alluxio.git master-2.x

Some checks failed. Please fix the reported issues and reply
alluxio-bot, check this please
to re-run checks.

@Archie-wang Archie-wang changed the title Fixed the issue where a null pointer exception occurred when logging … Fix the issue where a null pointer exception occurred when logging Feb 29, 2024
@Archie-wang Archie-wang changed the title Fix the issue where a null pointer exception occurred when logging Fix NPE during DelegatingBlockReader initialization with debug logging Feb 29, 2024
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

3 participants