File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
java-components/domain-proxy
client/src/main/java/com/redhat/hacbs/domainproxy/client
common/src/main/java/com/redhat/hacbs/domainproxy/common
server/src/main/java/com/redhat/hacbs/domainproxy/server Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,12 @@ private void startClient() {
7777 .open (UnixDomainSocketAddress .of (domainSocket ));
7878 executor .submit (channelToChannelBiDirectionalHandler (byteBufferSize , httpClientChannel ,
7979 domainSocketChannel ));
80- Thread .sleep (TIMEOUT_MS ); // Make sure virtual thread is running
8180 CommonIOUtil .threadDump ();
8281 }
8382 }
8483 }
8584 }
86- } catch (final IOException | InterruptedException e ) {
85+ } catch (final IOException e ) {
8786 Log .errorf (e , "Error initialising domain proxy client" );
8887 }
8988 Quarkus .asyncExit ();
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ public static void threadDump() throws IOException {
172172 // Create a timestamp with milliseconds for the file name
173173 String timestamp = new SimpleDateFormat ("yyyyMMdd_HHmmss_SSS" ).format (new Date ());
174174 String fileName = "/app/thread_dump_" + timestamp + ".txt" ;
175+ String threadDumpStr = "" ;
175176
176177 // Create a PrintWriter to write the thread dump to a file
177178 try (PrintWriter writer = new PrintWriter (new FileWriter (fileName ))) {
@@ -184,16 +185,15 @@ public static void threadDump() throws IOException {
184185
185186 // Write the thread information to the file
186187 for (ThreadInfo threadInfo : threadInfos ) {
187- writer . println ( "Thread ID: " + threadInfo .getThreadId () + " Name: " + threadInfo .getThreadName ()) ;
188- writer . println ( "Thread State: " + threadInfo .getThreadState ()) ;
188+ threadDumpStr += "Thread ID: " + threadInfo .getThreadId () + " Name: " + threadInfo .getThreadName () + " \n " ;
189+ threadDumpStr += "Thread State: " + threadInfo .getThreadState () + " \n " ;
189190 StackTraceElement [] stackTrace = threadInfo .getStackTrace ();
190191 for (StackTraceElement stackTraceElement : stackTrace ) {
191- writer . println ( "\t " + stackTraceElement ) ;
192+ threadDumpStr += "\t " + stackTraceElement + " \n " ;
192193 }
193- writer .println ();
194194 }
195195 }
196196
197- LOG .infof ( "Thread dump written to file: %s" , fileName );
197+ LOG .info ( threadDumpStr );
198198 }
199199}
Original file line number Diff line number Diff line change @@ -77,13 +77,12 @@ private void startServer() {
7777 .open (new InetSocketAddress (LOCALHOST , httpServerPort ));
7878 executor .submit (channelToChannelBiDirectionalHandler (byteBufferSize , httpServerChannel ,
7979 domainSocketChannel ));
80- Thread .sleep (TIMEOUT_MS ); // Make sure virtual thread is running
8180 CommonIOUtil .threadDump ();
8281 }
8382 }
8483 }
8584 }
86- } catch (final IOException | InterruptedException e ) {
85+ } catch (final IOException e ) {
8786 Log .errorf (e , "Error initialising domain proxy server" );
8887 }
8988 Quarkus .asyncExit ();
You can’t perform that action at this time.
0 commit comments