Skip to content

Commit a3a6fc2

Browse files
committed
Merge branch '2.1'
2 parents eae3672 + 33894e6 commit a3a6fc2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java

+9
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.apache.accumulo.core.rpc.UGIAssumingTransportFactory;
4848
import org.apache.accumulo.core.util.Halt;
4949
import org.apache.accumulo.core.util.Pair;
50+
import org.apache.accumulo.core.util.UtilWaitThread;
5051
import org.apache.accumulo.core.util.threads.ThreadPools;
5152
import org.apache.accumulo.core.util.threads.Threads;
5253
import org.apache.accumulo.server.ServerContext;
@@ -70,6 +71,7 @@
7071
import org.slf4j.Logger;
7172
import org.slf4j.LoggerFactory;
7273

74+
import com.google.common.base.Preconditions;
7375
import com.google.common.net.HostAndPort;
7476
import com.google.common.primitives.Ints;
7577

@@ -657,6 +659,13 @@ private static ServerAddress startTServer(ThriftServerType serverType, TimedProc
657659
}
658660
}).start();
659661

662+
while (!finalServer.isServing()) {
663+
// Wait for the thread to start and for the TServer to start
664+
// serving events
665+
UtilWaitThread.sleep(10);
666+
Preconditions.checkState(!finalServer.getShouldStop());
667+
}
668+
660669
// check for the special "bind to everything address"
661670
if (serverAddress.address.getHost().equals("0.0.0.0")) {
662671
// can't get the address from the bind, so we'll do our best to invent our hostname

0 commit comments

Comments
 (0)