File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
samples/snippets/src/main/java/com/example/spanner Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 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 */
4647public 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 }
You can’t perform that action at this time.
0 commit comments