Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[fix][broker] Continue closing even when executor is shut down #22599

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Apr 26, 2024

Motivation

2024-04-26T09:36:28,397 - ERROR - [ForkJoinPool.commonPool-worker-10:PersistentTopic] - [persistent://pulsar/global/removeClusterTest/__change_events] Error closing clients
java.util.concurrent.CompletionException: java.util.concurrent.RejectedExecutionException: Executor is shutting down
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:823) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:803) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.thenRunAsync(CompletableFuture.java:2204) ~[?:?]
	at org.apache.pulsar.broker.service.persistent.PersistentTopic.lambda$delete$44(PersistentTopic.java:1430) ~[classes/:?]
	at org.apache.pulsar.broker.resources.NamespaceResources$PartitionedTopicResources.lambda$runWithMarkDeleteAsync$9(NamespaceResources.java:359) ~[pulsar-broker-common-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) [?:?]
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) [?:?]
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) [?:?]
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) [?:?]
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) [?:?]
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) [?:?]
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) [?:?]
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) [?:?]
Caused by: java.util.concurrent.RejectedExecutionException: Executor is shutting down
	at org.apache.bookkeeper.common.util.SingleThreadExecutor.execute(SingleThreadExecutor.java:208) ~[bookkeeper-common-4.17.0.jar:4.17.0]
	at java.base/java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:817) ~[?:?]
	... 12 more

Modifications

  • provide custom Executor that catches RejectedExecutionException and runs in current thread in that case.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@lhotari lhotari added this to the 3.3.0 milestone Apr 26, 2024
@lhotari lhotari self-assigned this Apr 26, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Apr 26, 2024
@lhotari lhotari merged commit f8f256c into apache:master Apr 26, 2024
51 of 52 checks passed
lhotari added a commit that referenced this pull request Nov 23, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 26, 2024
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 26, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants