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
[Issue 7347] Avoid the NPE occurs in method ManagedLedgerImpl.isOffloadedNeedsDelete
#7389
[Issue 7347] Avoid the NPE occurs in method ManagedLedgerImpl.isOffloadedNeedsDelete
#7389
Conversation
@@ -41,7 +41,7 @@ | |||
public final static String[] DRIVER_NAMES = {"S3", "aws-s3", "google-cloud-storage", "filesystem"}; | |||
public final static String DEFAULT_OFFLOADER_DIRECTORY = "./offloaders"; | |||
public final static long DEFAULT_OFFLOAD_THRESHOLD_IN_BYTES = -1; | |||
public final static Long DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS = null; | |||
public final static long DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also change managedLedgerOffloadDeletionLagInMillis
to long
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default is couldn't be Null
, so I changed this field type to long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's fine. I was just saying to also change the type for the managedLedgerOffloadDeletionLagInMillis
field which is currently Long
. If null
is not a valid value, we should use long
type instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I changed it. Thanks.
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
ManagedLedgerImpl.isOffloadedNeedsDelete
/pulsarbot run-failure-checks |
2 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
…oadedNeedsDelete` (apache#7389) Fixes apache#7347 ### Motivation The default value of the offload-deletion-lag is `null`, this will cause an NPE problem. ### Modifications Add null check in the method `ManagedLedgerImpl.isOffloadedNeedsDelete`. ### Verifying this change Add unit test for method `ManagedLedgerImpl.isOffloadedNeedsDelete`. (cherry picked from commit eaf268c)
…oadedNeedsDelete` (apache#7389) Fixes apache#7347 ### Motivation The default value of the offload-deletion-lag is `null`, this will cause an NPE problem. ### Modifications Add null check in the method `ManagedLedgerImpl.isOffloadedNeedsDelete`. ### Verifying this change Add unit test for method `ManagedLedgerImpl.isOffloadedNeedsDelete`.
…oadedNeedsDelete` (apache#7389) Fixes apache#7347 ### Motivation The default value of the offload-deletion-lag is `null`, this will cause an NPE problem. ### Modifications Add null check in the method `ManagedLedgerImpl.isOffloadedNeedsDelete`. ### Verifying this change Add unit test for method `ManagedLedgerImpl.isOffloadedNeedsDelete`.
…oadedNeedsDelete` (#7389) Fixes #7347 ### Motivation The default value of the offload-deletion-lag is `null`, this will cause an NPE problem. ### Modifications Add null check in the method `ManagedLedgerImpl.isOffloadedNeedsDelete`. ### Verifying this change Add unit test for method `ManagedLedgerImpl.isOffloadedNeedsDelete`. (cherry picked from commit eaf268c)
…oadedNeedsDelete` (apache#7389) Fixes apache#7347 ### Motivation The default value of the offload-deletion-lag is `null`, this will cause an NPE problem. ### Modifications Add null check in the method `ManagedLedgerImpl.isOffloadedNeedsDelete`. ### Verifying this change Add unit test for method `ManagedLedgerImpl.isOffloadedNeedsDelete`.
Fixes #7347
Motivation
The default value of the offload-deletion-lag is
null
, this will cause an NPE problem.Modifications
Add null check in the method
ManagedLedgerImpl.isOffloadedNeedsDelete
.Verifying this change
Add unit test for method
ManagedLedgerImpl.isOffloadedNeedsDelete
.Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation