-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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][Offload] fix indexEntries NullPointerException error #22035
[fix][Offload] fix indexEntries NullPointerException error #22035
Conversation
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.
The close
method maybe be called more than once, so cause the issue. I think we can just let indexEntries=null
, no need to clear
it
@Technoboy- thanks. done |
Wouldn't that be a problem if the object instance gets recycled multiple times? |
maybe |
There have been bugs in the past with recycled objects that are caused by releasing the object multiple times. |
yes, but for this patch, it's ok to fix it like this, right? |
I doubt that it's correct. The problem will become worse if it is "fixed" like this. I think that it is necessary to address the root cause. |
@Technoboy- @graysonzeng I have shared more context in #22110 about the "double release" bug pattern. |
it looks like ML read entries from an already closed ledger, read entries from a closed ledger will lead to exception, and then, ML will try to close the ledger again. I believe the key point is ML trying to read entries from a closed ledger. |
@@ -94,7 +94,6 @@ public void recycle() { | |||
dataObjectLength = -1; | |||
dataHeaderLength = -1; | |||
segmentMetadata = null; | |||
indexEntries.clear(); |
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.
Remove this line cannot fix the root cause
@graysonzeng could please provide the steps that I can reproduce the issue? |
This is an occasional error that occurs only once. I can't try to reproduce it @dao-jun |
@graysonzeng what's your pulsar version? could you please provide more log? |
Closing and |
related PR: #22162 |
Thanks for the fix, I'll close it once the related PR is merged @dao-jun |
the pr closed automatically since #22162 merged. |
Motivation
Offloader exception occurs
Modifications
check indexEntries is not null
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: