alluxio
alluxio copied to clipboard
Fix NPE during DelegatingBlockReader initialization with debug logging
…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.
- 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.
- 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?
- No change in user-facing APIs: This PR does not modify any APIs that are exposed to the end-users.
- No addition or removal of property keys: There are no changes to the configuration properties as part of this PR.
- No changes to the WebUI: This PR does not involve any modifications to the WebUI.
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 [email protected]
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
@jja725 Hello, the unit test failure of this PR seems unrelated to my changes. Do you have any suggestions?