This is an automated email from the ASF dual-hosted git repository.
justinchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 6fb776cae12 Pipe: Restore RPC thread name after Pipe receiver exit
(#16344)
6fb776cae12 is described below
commit 6fb776cae12409f1e6f25268d4697d28cae97122
Author: nanxiang xia <[email protected]>
AuthorDate: Thu Sep 4 16:10:33 2025 +0800
Pipe: Restore RPC thread name after Pipe receiver exit (#16344)
* thread name
* thread name
---
.../apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
index b6316a42ddc..d2a5b8e1b56 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
@@ -72,6 +72,9 @@ public abstract class IoTDBFileReceiver implements
IoTDBReceiver {
private static final AtomicLong RECEIVER_ID_GENERATOR = new AtomicLong(0);
protected final AtomicLong receiverId = new AtomicLong(0);
+ // Used to restore the original thread name when the receiver is closed.
+ private String originalThreadName;
+
protected String username = CONNECTOR_IOTDB_USER_DEFAULT_VALUE;
protected String password = CONNECTOR_IOTDB_PASSWORD_DEFAULT_VALUE;
@@ -113,6 +116,9 @@ public abstract class IoTDBFileReceiver implements
IoTDBReceiver {
return new TPipeTransferResp(status);
}
+ if (originalThreadName == null) {
+ originalThreadName = Thread.currentThread().getName();
+ }
receiverId.set(RECEIVER_ID_GENERATOR.incrementAndGet());
Thread.currentThread()
.setName(
@@ -919,6 +925,10 @@ public abstract class IoTDBFileReceiver implements
IoTDBReceiver {
closeSession();
LOGGER.info("Receiver id = {}: Handling exit: Receiver exited.",
receiverId.get());
+
+ if (originalThreadName != null) {
+ Thread.currentThread().setName(originalThreadName);
+ }
}
protected abstract void closeSession();