This is an automated email from the ASF dual-hosted git repository.
justinchen pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/dev/1.3 by this push:
new 0cf023402f4 [To dev/1.3] Pipe: Restore RPC thread name after Pipe
receiver exit (#16344) (#16345)
0cf023402f4 is described below
commit 0cf023402f4c55f2a1c8f47122bcc9cc12005c8b
Author: nanxiang xia <[email protected]>
AuthorDate: Thu Sep 4 16:20:46 2025 +0800
[To dev/1.3] Pipe: Restore RPC thread name after Pipe receiver exit
(#16344) (#16345)
* 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 ca9b0c8dbc7..ad76cd4a184 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(
@@ -897,6 +903,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();