File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver Expand file tree Collapse file tree 1 file changed +10
-0
lines changed 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 (
@@ -919,6 +925,10 @@ public synchronized void handleExit() {
919925 closeSession ();
920926
921927 LOGGER .info ("Receiver id = {}: Handling exit: Receiver exited." , receiverId .get ());
928+
929+ if (originalThreadName != null ) {
930+ Thread .currentThread ().setName (originalThreadName );
931+ }
922932 }
923933
924934 protected abstract void closeSession ();
You can’t perform that action at this time.
0 commit comments