Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
*/
abstract class WorkerTask implements Runnable {
private static final Logger log = LoggerFactory.getLogger(WorkerTask.class);
private static final String THREAD_NAME_PREFIX = "task-thread-";

protected final ConnectorTaskId id;
private final TaskStatus.Listener statusListener;
Expand Down Expand Up @@ -215,7 +216,9 @@ protected synchronized void onResume() {
@Override
public void run() {
ClassLoader savedLoader = Plugins.compareAndSwapLoaders(loader);
String savedName = Thread.currentThread().getName();
try {
Thread.currentThread().setName(THREAD_NAME_PREFIX + id);
doRun();
onShutdown();
} catch (Throwable t) {
Expand All @@ -225,6 +228,7 @@ public void run() {
throw (Error) t;
} finally {
try {
Thread.currentThread().setName(savedName);
Plugins.compareAndSwapLoaders(savedLoader);
shutdownLatch.countDown();
} finally {
Expand Down