clear context map before/after threads run
package org.zstack.core.thread;
+import org.apache.logging.log4j.ThreadContext;
import org.zstack.utils.logging.CLogger;
import org.zstack.utils.logging.CLoggerImpl;
@@ -34,6 +35,8 @@ public class ScheduledThreadPoolExecutorExt extends ScheduledThreadPoolExecutor
@Override
protected void beforeExecute(Thread t, Runnable r) {
+ ThreadContext.clearMap();
+
ThreadAroundHook debugHook = null;
List<ThreadAroundHook> tmpHooks;
synchronized (_hooks) {
@@ -52,6 +55,8 @@ public class ScheduledThreadPoolExecutorExt extends ScheduledThreadPoolExecutor
@Override
protected void afterExecute(Runnable r, Throwable t) {
+ ThreadContext.clearMap();
+
ThreadAroundHook debugHook = null;
List<ThreadAroundHook> tmpHooks;
synchronized (_hooks) {
