lhotari opened a new issue, #20797:
URL: https://github.com/apache/pulsar/issues/20797

   Thread leaks:
   ```
   ❯ grep -shEr "created [0-9]+ new threads" pulsar-broker | awk -F "Summary: " 
'{ print $2 }' | awk '{ print $(NF-2), $0}' |sort -rn | cut -f2- -d' '
   Tests in class org.apache.pulsar.broker.service.ServerCnxTest created 849 
new threads
   Tests in class org.apache.pulsar.broker.service.ClusterMigrationTest created 
743 new threads
   Tests in class 
org.apache.pulsar.broker.transaction.AuthenticatedTransactionProducerConsumerTest
 created 100 new threads
   Tests in class org.apache.pulsar.broker.loadbalance.LoadBalancerTest created 
92 new threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.MultiBrokerLeaderElectionTest created 89 
new threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.MultiBrokerLeaderElectionExpirationTest 
created 81 new threads
   Tests in class 
org.apache.pulsar.broker.transaction.pendingack.PendingAckInMemoryDeleteTest 
created 78 new threads
   Tests in class 
org.apache.pulsar.broker.transaction.buffer.TransactionStablePositionTest 
created 78 new threads
   Tests in class org.apache.pulsar.broker.service.MessageCumulativeAckTest 
created 62 new threads
   Tests in class org.apache.pulsar.broker.service.ReplicatorTest created 61 
new threads
   Tests in class org.apache.pulsar.broker.service.BrokerBookieIsolationTest 
created 51 new threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.SimpleLoadManagerImplTest created 51 new 
threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.ModularLoadManagerImplTest created 47 new 
threads
   Tests in class org.apache.pulsar.broker.service.TopicOwnerTest created 40 
new threads
   Tests in class org.apache.pulsar.broker.service.BrokerServiceTest created 37 
new threads
   Tests in class org.apache.pulsar.broker.service.BrokerBkEnsemblesTests 
created 32 new threads
   Tests in class org.apache.pulsar.broker.SLAMonitoringTest created 31 new 
threads
   Tests in class org.apache.pulsar.broker.service.ReplicatorAdminTlsTest 
created 26 new threads
   Tests in class 
org.apache.pulsar.broker.service.ReplicatorAdminTlsWithKeyStoreTest created 25 
new threads
   Tests in class 
org.apache.pulsar.broker.service.persistent.PersistentSubscriptionTest created 
25 new threads
   Tests in class org.apache.pulsar.broker.service.PeerReplicatorTest created 
24 new threads
   Tests in class org.apache.pulsar.broker.service.ReplicatorSubscriptionTest 
created 23 new threads
   Tests in class org.apache.pulsar.broker.service.MaxMessageSizeTest created 
23 new threads
   Tests in class org.apache.pulsar.broker.service.ReplicatorTopicPoliciesTest 
created 22 new threads
   Tests in class org.apache.pulsar.broker.service.OneWayReplicatorTest created 
20 new threads
   Tests in class org.apache.pulsar.broker.service.schema.SchemaServiceTest 
created 18 new threads
   Tests in class org.apache.pulsar.broker.service.ReplicatorTlsTest created 18 
new threads
   Tests in class org.apache.pulsar.broker.service.ReplicatorRemoveClusterTest 
created 18 new threads
   Tests in class org.apache.pulsar.broker.service.BacklogQuotaManagerTest 
created 17 new threads
   Tests in class 
org.apache.pulsar.broker.service.schema.PartitionedTopicsSchemaTest created 16 
new threads
   Tests in class org.apache.pulsar.broker.loadbalance.SimpleBrokerStartTest 
created 13 new threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.LeaderElectionServiceTest created 13 new 
threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.impl.BundleSplitterTaskTest created 13 new 
threads
   Tests in class org.apache.pulsar.broker.auth.AuthorizationTest created 12 
new threads
   Tests in class 
org.apache.pulsar.broker.service.persistent.PersistentStickyKeyDispatcherMultipleConsumersTest
 created 11 new threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.extensions.scheduler.UnloadSchedulerTest 
created 10 new threads
   Tests in class 
org.apache.pulsar.broker.intercept.MangedLedgerInterceptorImplTest created 10 
new threads
   Tests in class org.apache.pulsar.broker.service.OpportunisticStripingTest 
created 9 new threads
   Tests in class org.apache.pulsar.broker.service.ManagedLedgerCompressionTest 
created 9 new threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.extensions.AntiAffinityNamespaceGroupExtensionTest
 created 8 new threads
   Tests in class org.apache.pulsar.broker.stats.ManagedCursorMetricsTest 
created 7 new threads
   Tests in class org.apache.pulsar.broker.service.BusyWaitServiceTest created 
7 new threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.extensions.BrokerRegistryTest created 7 
new threads
   Tests in class org.apache.pulsar.broker.web.WebServiceTest created 6 new 
threads
   Tests in class org.apache.pulsar.broker.service.PersistentMessageFinderTest 
created 6 new threads
   Tests in class 
org.apache.pulsar.broker.loadbalance.extensions.channel.ServiceUnitStateChannelTest
 created 6 new threads
   Tests in class org.apache.pulsar.broker.BrokerAdditionalServletTest created 
6 new threads
   Tests in class org.apache.pulsar.broker.service.PersistentFailoverE2ETest 
created 5 new threads
   Tests in class org.apache.pulsar.broker.service.NonPersistentTopicE2ETest 
created 5 new threads
   Tests in class org.apache.pulsar.broker.service.InactiveTopicDeleteTest 
created 5 new threads
   Tests in class org.apache.pulsar.broker.service.ExclusiveProducerTest 
created 5 new threads
   ```
   
   _Originally posted by @lhotari in 
https://github.com/apache/pulsar/issues/20673#issuecomment-1633958559_
               
   In some cases, it's possible that detected thread leaks are false positives.
   One reason for that is that broker shutdown is asynchronous in tests because 
of performance reasons. Broker shutdown can be made to wait for completion in 
tests by setting `svcConfig.setBrokerShutdownTimeoutMs(5000L);`
   
   
    


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to