[Issue 7347] Avoid the NPE occurs in method ManagedLedgerImpl.isOffloadedNeedsDelete - #7389
Conversation
| 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.
Should we also change managedLedgerOffloadDeletionLagInMillis to long?
There was a problem hiding this comment.
This default is couldn't be Null, so I changed this field type to long.
There was a problem hiding this comment.
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.
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
yeswas chosen, please highlight the changesDocumentation