Skip to content

Commit 9082cca

Browse files
committed
update comment as per findings
1 parent 15c4881 commit 9082cca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

samples/snippets/src/main/java/com/example/spanner/TracingSample.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@
4040
*
4141
* @deprecated The OpenCensus project is deprecated. Use OpenTelemetry to enable metrics and stats
4242
* with cloud spanner client.
43-
* <p>Note: This sample uses System.exit(0) to ensure clean termination due to OpenCensus
44-
* background threads.
43+
* <p>Note: This sample uses System.exit(0) to ensure clean termination because the
44+
* ZPageHandlers HTTP server (localhost:8080/tracez) uses non-daemon threads and does not
45+
* provide a public stop() method.
4546
*/
4647
public class TracingSample {
4748

@@ -107,8 +108,8 @@ public static void main(String[] args) throws Exception {
107108
// Close the spanner client
108109
spanner.close();
109110

110-
// Force immediate exit since this is a sample application and OpenCensus
111-
// background threads might prevent clean shutdown
111+
// Force immediate exit since ZPageHandlers.startHttpServerAndRegisterAll(8080)
112+
// starts a non-daemon HTTP server thread that cannot be stopped gracefully
112113
System.exit(0);
113114
}
114115
}

0 commit comments

Comments
 (0)