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/12/03 16:15:57 UTC
[GitHub] [pulsar] merlimat commented on a change in pull request #12930: [Issue 12929] [pulsar-metadata] Fix metadata store deadlock
merlimat commented on a change in pull request #12930:
URL: https://github.com/apache/pulsar/pull/12930#discussion_r762069116
##########
File path: pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java
##########
@@ -73,9 +77,30 @@
protected abstract CompletableFuture<Boolean> existsFromStore(String path);
+ // TaskWrapper, wraps the task to be run.
+ // It records the thread on which the task is running. This is to help log the stack trace of a
+ // long running task.
+ static private class TaskWrapper implements Runnable {
+
+ private Runnable runnableTask;
+
+ @Getter
+ private volatile Thread taskThread;
+
+ public TaskWrapper(Runnable task) {
+ runnableTask = task;
+ }
+ @Override
+ public void run() {
+ taskThread = Thread.currentThread();
+ runnableTask.run();
+ }
+ }
+
protected AbstractMetadataStore() {
this.executor = Executors
.newSingleThreadExecutor(new DefaultThreadFactory("metadata-store"));
+ this.executorWatchDog = Executors.newSingleThreadExecutor(new DefaultThreadFactory("metadata-store-watchdog"));
Review comment:
We cannot do per each single request though. We could try to schedule periodic "keep-alive" tasks in these threads and it if they're not completed in X time, kill the broker.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org