lhotari opened a new pull request #9308:
URL: https://github.com/apache/pulsar/pull/9308
### Motivation
The main motivation for making this change to shut down port listeners
synchronously in `BrokerService.close` is to reduce test flakiness.
While investigating the flaky test MessageIdTest, these type of exceptions
were seen in logs:
```
Caused by: java.util.concurrent.RejectedExecutionException: Task
org.apache.pulsar.metadata.impl.AbstractMetadataStore$$Lambda$669/1529307342@2f790c2a
rejected from java.util.concurrent.ThreadPoolExecutor@ad9a9ac[Terminated, pool
size = 0, active threads = 0, queued tasks = 0, completed tasks = 9]
at
java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
~[?:1.8.0_275]
at
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
~[?:1.8.0_275]
at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
~[?:1.8.0_275]
at
java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:668)
~[?:1.8.0_275]
at
org.apache.pulsar.metadata.impl.AbstractMetadataStore.receivedNotification(AbstractMetadataStore.java:128)
~[pulsar-metadata-2.8.0-SNAPSHOT.jar:2.8.0-SNAPSHOT]
at
org.apache.pulsar.metadata.impl.ZKMetadataStore.process(ZKMetadataStore.java:320)
~[pulsar-metadata-2.8.0-SNAPSHOT.jar:2.8.0-SNAPSHOT]
at
org.apache.zookeeper.MockZooKeeper.lambda$setData$16(MockZooKeeper.java:728)
~[testmocks-2.8.0-SNAPSHOT.jar:3.5.7]
at
com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:321)
~[guava-30.1-jre.jar:?]
at
org.apache.zookeeper.MockZooKeeper.setData(MockZooKeeper.java:683)
~[testmocks-2.8.0-SNAPSHOT.jar:3.5.7]
at
org.apache.pulsar.metadata.impl.ZKMetadataStore.put(ZKMetadataStore.java:207)
~[pulsar-metadata-2.8.0-SNAPSHOT.jar:2.8.0-SNAPSHOT]
at
org.apache.bookkeeper.mledger.impl.MetaStoreImpl.asyncUpdateLedgerIds(MetaStoreImpl.java:106)
~[managed-ledger-2.8.0-SNAPSHOT.jar:2.8.0-SNAPSHOT]
at
org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.lambda$null$1(ManagedLedgerImpl.java:472)
~[managed-ledger-2.8.0-SNAPSHOT.jar:2.8.0-SNAPSHOT]
at
org.apache.bookkeeper.mledger.util.SafeRun$1.safeRun(SafeRun.java:32)
~[managed-ledger-2.8.0-SNAPSHOT.jar:2.8.0-SNAPSHOT]
... 6 more
```
It seems that this problem could occur when the test code is able to access
the broker instance that is already terminated.
### Modifications
Wait 10 seconds for `listenChannel` and `listenChannelTls` to stop in
`BrokerService`.
----------------------------------------------------------------
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:
[email protected]