File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/org/tikv/common Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,14 @@ public class TiSession implements AutoCloseable {
7171 private MetricsServer metricsServer ;
7272
7373 public TiSession (TiConfiguration conf ) {
74+ // may throw org.tikv.common.MetricsServer - http server not up
75+ // put it at the beginning of this function to avoid unclosed Thread
76+ this .metricsServer = MetricsServer .getInstance (conf );
77+
7478 this .conf = conf ;
7579 this .channelFactory = new ChannelFactory (conf .getMaxFrameSize ());
7680 this .client = PDClient .createRaw (conf , channelFactory );
7781 this .enableGrpcForward = conf .getEnableGrpcForward ();
78- this .metricsServer = MetricsServer .getInstance (conf );
7982 if (this .enableGrpcForward ) {
8083 logger .info ("enable grpc forward for high available" );
8184 }
You can’t perform that action at this time.
0 commit comments