File tree Expand file tree Collapse file tree
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ public abstract class IoTDBFileReceiver implements IoTDBReceiver {
7272 private static final AtomicLong RECEIVER_ID_GENERATOR = new AtomicLong (0 );
7373 protected final AtomicLong receiverId = new AtomicLong (0 );
7474
75+ // Used to restore the original thread name when the receiver is closed.
76+ private String originalThreadName ;
77+
7578 protected String username = CONNECTOR_IOTDB_USER_DEFAULT_VALUE ;
7679 protected String password = CONNECTOR_IOTDB_PASSWORD_DEFAULT_VALUE ;
7780
@@ -113,6 +116,9 @@ protected TPipeTransferResp handleTransferHandshakeV1(final PipeTransferHandshak
113116 return new TPipeTransferResp (status );
114117 }
115118
119+ if (originalThreadName == null ) {
120+ originalThreadName = Thread .currentThread ().getName ();
121+ }
116122 receiverId .set (RECEIVER_ID_GENERATOR .incrementAndGet ());
117123 Thread .currentThread ()
118124 .setName (
@@ -897,6 +903,10 @@ public synchronized void handleExit() {
897903 closeSession ();
898904
899905 LOGGER .info ("Receiver id = {}: Handling exit: Receiver exited." , receiverId .get ());
906+
907+ if (originalThreadName != null ) {
908+ Thread .currentThread ().setName (originalThreadName );
909+ }
900910 }
901911
902912 protected abstract void closeSession ();
You can’t perform that action at this time.
0 commit comments