8151141: Sjavac fails to fork server on Windows
Reverted changeset 3269:80c06d9873bd. Reviewed-by: jlahoda
This commit is contained in:
parent
460020d183
commit
ea360f901f
@ -257,7 +257,7 @@ public class SjavacClient implements Sjavac {
|
|||||||
// serverProcess != null at this point.
|
// serverProcess != null at this point.
|
||||||
try {
|
try {
|
||||||
// Throws an IOException if no valid values materialize
|
// Throws an IOException if no valid values materialize
|
||||||
portFile.waitForValidValues(serverProcess);
|
portFile.waitForValidValues();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
// Process was started, but server failed to initialize. This could
|
// Process was started, but server failed to initialize. This could
|
||||||
// for instance be due to the JVM not finding the server class,
|
// for instance be due to the JVM not finding the server class,
|
||||||
|
@ -232,7 +232,7 @@ public class PortFile {
|
|||||||
/**
|
/**
|
||||||
* Wait for the port file to contain values that look valid.
|
* Wait for the port file to contain values that look valid.
|
||||||
*/
|
*/
|
||||||
public void waitForValidValues(Process serverProcess) throws IOException, InterruptedException {
|
public void waitForValidValues() throws IOException, InterruptedException {
|
||||||
final int MS_BETWEEN_ATTEMPTS = 500;
|
final int MS_BETWEEN_ATTEMPTS = 500;
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
long timeout = startTime + getServerStartupTimeoutSeconds() * 1000;
|
long timeout = startTime + getServerStartupTimeoutSeconds() * 1000;
|
||||||
@ -250,9 +250,6 @@ public class PortFile {
|
|||||||
if (System.currentTimeMillis() > timeout) {
|
if (System.currentTimeMillis() > timeout) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!serverProcess.isAlive()) {
|
|
||||||
throw new IOException("Server process terminated.");
|
|
||||||
}
|
|
||||||
Thread.sleep(MS_BETWEEN_ATTEMPTS);
|
Thread.sleep(MS_BETWEEN_ATTEMPTS);
|
||||||
}
|
}
|
||||||
throw new IOException("No port file values materialized. Giving up after " +
|
throw new IOException("No port file values materialized. Giving up after " +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user