You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:02:46 UTC

[GitHub] [pulsar] lhotari opened a new pull request #10977: [Broker] Fix direct memory leak in getLastMessageId

lhotari opened a new pull request #10977:
URL: https://github.com/apache/pulsar/pull/10977


   Fixes #7304
   
   ### Motivation
   
   See #7304 for the details. There's a memory leak when calling lastMessageId API.
   
   I used the instructions by @megfigura in https://github.com/apache/pulsar/issues/7304#issuecomment-854943245 to reproduce.
   
   In one terminal window I started pulsar-perf produce to create 5 msg/second to the topic called "test"
   ```bash
   pulsar-perf produce -r 5 -m 100000 test
   ```
   
   Then in another window I ran the loop to call lastMessageId in a tight loop:
   ```bash
   while true; do curl http://pulsar-testenv-deployment-broker.pulsar-testenv.svc.cluster.local:8080/admin/v2/persistent/public/default/test/lastMessageId; echo ; done
   ```
   
   In a third terminal window, I had the broker logs filtered for errors or leak logs :
   ```bash
   kubectl -n pulsar-testenv logs -f pod/pulsar-testenv-deployment-broker-0 |tee broker_logs_`date +%s`.txt | egrep 'ERROR|OOM|LEAK'
   ```
   
   The test environment was deployed with these values.yaml settings: https://github.com/lhotari/pulsar-playground/blob/f39b83b9e08f80af57fb70b1439f6c466c1f4405/test-env/1node/values.yaml
   
   The memory leak problem reproduces almost immediately.
   
   ### Modifications
   
   Add the missing `entry.release()` call to `PersistentTopic.getLastMessageId`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] merlimat merged pull request #10977: [Broker] Fix direct memory leak in getLastMessageId

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #10977:
URL: https://github.com/apache/pulsar/pull/10977


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org