You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The heap dump has reached 13GB and cannot be uploaded
compress it and upload to cloud driver, such as 百度云? it is very important to locate the root cause
@graysonzeng@dao-jun please notice that the heap dump could contain sensitive data. it should be never shared without encryption because of this.
encrypting for a specific recipient with gpg is one possible solution.
@lhotari Yes. And I found that these instances are referenced by waitingCursors in the ManagedLedgerImpl instance. At the same time, the Cursor is in the isActive = false state. This indicates that they should be deleted and should not still be retained by waitingCursors.
We used routine load task in starrocks for reader consume, and created and deleted consumers multiple times. Therefore, many NonDurableCursorImpl will be generated.
pulsar version is 3.1.1。It looks like related to #13939 . It looks like maybe removeWaitingCursor is not properly removing the cursor after deactivateCursor() converts the cursor's isActive to false. @lhotari
Another possibility is that non-durable cursors and related subscriptions should be cleaned up when a connection dies in an unexpected way. I'm not sure how that is handled in the code base currently.
Activity
dao-jun commentedon Feb 29, 2024
could you please upload the heap dump file?
graysonzeng commentedon Feb 29, 2024
The heap dump has reached 13GB and cannot be uploaded
dao-jun commentedon Feb 29, 2024
compress it and upload to cloud driver, such as 百度云? it is very important to locate the root cause
lhotari commentedon Feb 29, 2024
@graysonzeng @dao-jun please notice that the heap dump could contain sensitive data. it should be never shared without encryption because of this.
encrypting for a specific recipient with gpg is one possible solution.
lhotari commentedon Feb 29, 2024
@graysonzeng from the screenshots, it looks like the problem is caused by the 6.5 million NonDurableCursorImpl instances.
lhotari commentedon Feb 29, 2024
I'd recommend adding https://github.com/vlsi/mat-calcite-plugin plugin to Eclipse MAT so that you can do SQL queries to the heap dump. Eclipse MAT has OQL support, but that's not so handy as the SQL queries where you can do anything that Calcite supports with SQL.
not useful for this case, but an example of a Calcite query using Eclipse MAT + Calcite plugin:
graysonzeng commentedon Feb 29, 2024
@lhotari Yes. And I found that these instances are referenced by
waitingCursorsin theManagedLedgerImplinstance. At the same time, the Cursor is in the isActive = false state. This indicates that they should be deleted and should not still be retained by waitingCursors.We used routine load task in starrocks for reader consume, and created and deleted consumers multiple times. Therefore, many NonDurableCursorImpl will be generated.
lhotari commentedon Feb 29, 2024
@graysonzeng related to #13939 ?
graysonzeng commentedon Feb 29, 2024
pulsar version is 3.1.1。It looks like related to #13939 . It looks like maybe removeWaitingCursor is not properly removing the cursor after deactivateCursor() converts the cursor's isActive to false. @lhotari
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Lines 310 to 311 in 6ec473e
graysonzeng commentedon Feb 29, 2024
lhotari commentedon Feb 29, 2024
Another possibility is that non-durable cursors and related subscriptions should be cleaned up when a connection dies in an unexpected way. I'm not sure how that is handled in the code base currently.
lhotari commentedon Feb 29, 2024
Or maybe cleaned up after an inactivity period?
Technoboy- commentedon Mar 4, 2024
There is a race condition between the
consumer.closeandcheckForNewEntries.When the consumer is closed, the
waitingCursoris empty.pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Lines 298 to 313 in ccc2ea6
Then after executing line-311, the cursor was added to
waitingCursor.Reproduced test
Add sleep time for
checkForNewEntries, like 10s.pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Lines 983 to 989 in ccc2ea6
Then the below test will reproduce.