{"record":{"id":"27138870ae953209","repo":"openjdk/jdk","slug":"no-port-file-values-materialized-giving-up-after","errorCode":null,"errorMessage":"No port file values materialized. Giving up after {} ms","messagePattern":"No port file values materialized\\. Giving up after (.+?) ms","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"make/langtools/tools/javacserver/shared/PortFile.java","lineNumber":260,"sourceCode":"        long startTime = System.currentTimeMillis();\n        long timeout = startTime + getServerStartupTimeoutSeconds() * 1000;\n        while (true) {\n            Log.debug(\"Looking for valid port file values...\");\n            if (exists()) {\n                lock();\n                getValues();\n                unlock();\n            }\n            if (containsPortInfo) {\n                Log.debug(\"Valid port file values found after \" + (System.currentTimeMillis() - startTime) + \" ms\");\n                return;\n            }\n            if (System.currentTimeMillis() > timeout) {\n                break;\n            }\n            Thread.sleep(MS_BETWEEN_ATTEMPTS);\n        }\n        throw new IOException(\"No port file values materialized. Giving up after \" +\n                                      (System.currentTimeMillis() - startTime) + \" ms\");\n    }\n\n    /**\n     * Check if the portfile still contains my values, assuming that I am the server.\n     */\n    public boolean stillMyValues() throws IOException, FileNotFoundException, InterruptedException {\n        for (;;) {\n            try {\n                lock();\n                getValues();\n                unlock();\n                if (containsPortInfo) {\n                    if (serverPort == myServerPort &&\n                        serverCookie == myServerCookie) {\n                        // Everything is ok.\n                        return true;\n                    }","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/make/langtools/tools/javacserver/shared/PortFile.java#L242-L278","documentation":"IOException from PortFile.waitForValidValues(): the caller (typically a client after triggering server startup) polled lock/getValues/unlock for the port file until a per-call timeout elapsed, but the file never contained valid server connection values. The message reports the actual elapsed milliseconds spent waiting.","triggerScenarios":"Client starts a new javacserver and waits for the daemon to write its port into the shared port file; the daemon crashes before writing, or the values it writes are for a different server incarnation (mismatched cookie), so containsPortInfo never becomes true.","commonSituations":"Forked server dying at startup (see 'Server failed to initialize'); concurrent clients racing where one deletes the port file; slow or hung disks delaying the daemon's write past the timeout.","solutions":["Increase the wait timeout so slow machine startup (cold JVM, loaded CI host) completes.","Diagnose why the daemon never wrote values: run it in the foreground and watch its output.","Clear stale port files and orphaned server processes before the build.","Check for disk/filesystem latency on the port file directory."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before waiting, cheaply check the daemon is even alive\nif (!serverProcess.isAlive())\n    throw new IOException(\"javacserver daemon exited before writing the port file; see its output\");","typeGuard":null,"tryCatchPattern":"try {\n    portFile.waitForValidValues(timeoutMs);\n} catch (IOException e) {\n    if (serverProcess.isAlive() && elapsed < hardLimit) {\n        portFile.waitForValidValues(timeoutMs * 2); // one backoff retry on loaded hosts\n    } else {\n        killServerAndRemovePortFile(); // avoid poisoned state for the next client\n        throw e;\n    }\n}","preventionTips":["Scale the wait timeout with machine load (CI parallelism, cold caches).","Always remove the port file after a failed server start so later clients fork a fresh one.","Watch daemon liveness while polling rather than waiting out the full timeout blindly."],"tags":["javacserver","timeout","polling","startup-race","build"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}